PDA

View Full Version : CAD2SHAP 3.0 still cannot handle my XDATA properly !!


ski
23-08-2007, 11:00 AM
hello, GuthCAD Software Support Administrator,

MY dwg file has been put xdata in as attributes. The xdata were organised in LISP is:

(-3 ("济南控规:地块"
(1002 . "{")
(1000 . "DLH-01-16")
(1000 . "C2")
(1000 . "商业金融业")
(1000 . "7.2")
(1000 . "4.0")
(1000 . "25")
(1000 . "100")
(1000 . "35")
(1000 . "中水站1处,公共厕所1处,换热站2处,配电所3处")
(1000 . "E/W/S/SW")
(1000 . "2880")
(1000 . "未建")
(1000 . "C1/C3")
(1000 . "无")
(1000 . "地下停车场、商业经营")
(1000 . "二级公交换乘枢纽,用于换乘用地不小于2000平方米。")
(1000 . "20060418-0.001")
(1002 . "}")
)
)

I have 17 attributes-xdata in dwg. But in CAD2SHPE, it's only 9 can be found. CAD2SHAPE lost one attributes-xdata-Group after found one "1000 group".

http://img214.imageshack.us/img214/3479/myxdad2qo4.jpg

I attached my sample dwg file. PLS help me to get the answer.

THX.

GuthCAD Software Support
23-08-2007, 11:59 AM
Hi,

Thanks for the question.

As you probably realize, the format of XData is user defined, so it is not really possible for CAD2Shape to know in advance every use of XData. Currently the software supports 3 formats, arbitrarily named:

XDATA_FORMAT_TYPE1
XDATA_FORMAT_TYPE2
XDATA_FORMAT_TYPE3

Details on each format can be found in CAD2Shape User manual topic 'Developer Version | Functions Reference | Info Functions | C2S_XDATA'. Actually what each of the 3 currently supported formats have in common is the notion of a 'Name' field followed by a 'Data' field. I guess that the design reason behind this is that shapefiles store data in DBF database files which have named fields. For the data format that you have selected 'XDATA_TYPE2', CAD2Shape expects the Xdata to be organised in name/value pairs in the order:

name
value
...
name
value

Since your data has no named fields, just values, CAD2Shape is interpreting half the data fields as name fields, and so it is reporting that the Xdata consists of 9 fields instead of the 17 that you expect.

So what to do?!

From our side we will schedule to support XData without field names. I can see that it is quite reasonable to simply store the data values, and rely on the position of the data to know what they are. So we can implement a format to support that, and will just give the fields arbitrary names such as Xdata1, Xdata2, .. etc.
Unfortunately I cannot say at this stage how long it will be before we would be able to implement that.

From your side, it could be solved by changing the format of your xdata. For XDATA_TYPE1 change your output to:


(-3 ("济南控规:地块"
(1002 . "{")
(1000 . "x1=DLH-01-16")
(1000 . "x2=C2")
(1000 . "x3=商业金融业")
(1000 . "x4=7.2")

etc.

or for XDATA_TYPE2 format use:

(-3 ("济南控规:地块"
(1002 . "{")
(1000 . "x1")
(1000 . "DLH-01-16")
(1000 . "x2")
(1000 . "C2")
(1000 . "x3")
(1000 . "商业金融业")
(1000 . "x4")
(1000 . "7.2")

etc.

I hope that it helps!

Best regards,
Software Support

ski
30-08-2007, 10:55 AM
THX, GuthCAD Software Support Administrator,
The problem has been solved.