Use ObjectDBX/RealDWG to read PropertySetDef from solid3D
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I am not a professional programmer, but manage overall ![]()
I am working on a tool to do the following:
-Open Revit and load a project (manual operation, this is to be a Revit plugin)
-Open a DWG containing multiple solid3D object’s that have PropertySet attached to them.
-Export each individual solid3D to a new file. The filename of the new file is based on the Properties from the solid3D’s PropertySet.
-Close the DWG
-Create a new family in Revit
-Import the individual solid3D from each of the DWG’s just created in a separate family.
-Apply some parameter info to the family
-Load the family in the open project
-Loop for all created DWG’s
-(Would be nice do do a partial explode of the import, as it would become a generic model instead of a ImportSymbol, but this is an extra; have not found API functionality for this yet)
Now, I created a AutoCAD plugin to do this (first part of creating new DWG’s) without problem’s, so I think the code is OK.
I want to run this code from within Revit using the RealDWG method of reading a DWG into a database.
I am able to count the number of solid3D’s in the main DWG, but when I try to access the PropertySet, I only get a ProxyObject.
I think this is due to the fact that the side-databases are not fully loaded in RealDWG, but how to force this? When I search the for a I found these articles:
http://adndevblog.typepad.com/aec/2013/09/call-c-api-functions-from-net-addin.html
http://adndevblog.typepad.com/autocad/2015/07/exploding-aec-entities-using-realdwg.html
but also:
https://forums.autodesk.com/t5/net/is-there-a-way-to-access-aec-object-aec-wall-etc-properties-from/...
In the second posting there is an example to use PInvoke to load the sidedb. When I use that example my Plugin and Revit crashes (unexpected error).
Could someone verify that the ordinal mentioned in the example is correct (is a UNNAMED one) or point me on how to fully load the AEC portion of the DWG in RealDWG?
Thanx in advance!
WBMK