Formula Property Definition using Object Data

Formula Property Definition using Object Data

dwattersAMXH5
Enthusiast Enthusiast
1,687 Views
5 Replies
Message 1 of 6

Formula Property Definition using Object Data

dwattersAMXH5
Enthusiast
Enthusiast

hello, 

I am looking to pull OD into a VBA for Formula Property Definition 

 

this is what i was trying to use - "fqn_id" being the field to pull OD records from 

RESULT="--"
ON ERROR RESUME NEXT 

Dim ODrcs As ODRecords
Set amap = ThisDrawing.Application.GetInterfaceObject("AutoCADMap.Application")
Set ODrcs = amap.Projects.Item(ThisDrawing).ODTables.Item("FQN_ID").GetODRecords 

RESULT= ODrcs 

but that doesn't work 

 

 

i have loads of data stored in PLines from GIS Files brought in with MapImport and we need to get that data to the Property Set so we can use it with Civil3d labels and tables 

 

 

any advice on this would be greatly appreciated!

0 Likes
1,688 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable

I am also curious about this. Is there a formula that will take object data field to a property set field? I am kind of in the same situation as the OP above.

Thanks for any insight...

0 Likes
Message 3 of 6

dwattersAMXH5
Enthusiast
Enthusiast

this is possible, though i dont know the exact for how. 
but with using C# a program can be made to do it as both sets of data are accessible by .net 
you would need to know some about computer programming or find a programmer who can learn enough about CAD to do it. 

i found also though that Object Data can be accessed by lisp routines and i ended up creating a few lisps to make mleaders with the data i want out of the object data tables, then another lisp to recreate the mleader if you change the info in the object data table.  

0 Likes
Message 4 of 6

Anonymous
Not applicable

Interesting. So with Lisp routines are you still getting that data from the MLeader into the property set definitions that are attached back into the polylines?

 

 

0 Likes
Message 5 of 6

dwattersAMXH5
Enthusiast
Enthusiast

no,  i only wanted them in property set data to create labels with (wanted to use label templates in civil3d) but with the mleaders pulling the data and being able to set up the mleader how i want it, the lisp solves my problem. but i cant use civil3d tables this way. 

0 Likes
Message 6 of 6

norman.yuan
Mentor
Mentor

Object Data and PropertySet data are 2 different mechanisms to attaching atribute data to entities, as you know. While PropertySet supports Formula property, OD does not.

 

I assume your interest is in situation like: entities have OD data attached; you also have PropertSet defined in the drawing, with some formula property, or properties; then you want to attach the propertyset to entities and the formula property would take data from OD data as the formula input.

 

I'd say this would be doable, if you know how to access PropertySet and OD. AFAIK, there is no COM API support to access PropertySet data (I am not 100% sure, though), you probably cannot do it via VBA. If you have experience with AutoCAD/Map/Civil3D .NET APIs, you should be able to do it. There are previous discussions on this top with @dwattersAMXH5 involved that may give you more information:

 

https://forums.autodesk.com/t5/visual-basic-customization/pulling-object-data-and-writing-property-s...

 

https://forums.autodesk.com/t5/civil-3d-customization/property-sets-lt-gt-object-data-sonverter/m-p/...

 

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes