PDA

View Full Version : Property Set Definition: Formula Def for ACAD OBJs



freedomonek
2010-02-26, 06:00 PM
Hello,
I'm using ACA 2009. I have users who have developed some of their 3d objects using 3D Solids. We generally build 3d content using the site actual z-coordinate, so the z-location property is important for our use.

I've created a PropertySet to capture 3D-Solid Objects info. As you know the Automatic Property Definitions are limited is limited for them. So, I used a Formula Property to get at the Object property.

The following test VB-Script will capture the 3D-Solid "Volume" just fine:


Set acadApp = GetObject(,"AutoCAD.Application")
Set SolObj = acadApp.ActiveDocument.ObjectIDToObject( "[ObjectID]" )
RESULT = SolObj.Volume/1728


But try the same method for the "Position" returns a "square ? square":

Set acadApp = GetObject(,"AutoCAD.Application")
Set thisObj = acadApp.ActiveDocument.ObjectIDToObject( [ObjectID] )
RESULT = (thisObj.Position)


I tried "thisObj.Position.(2)" as well.
It seems it's trying to return something, but doesn't know how to display on the extended Data Tab. It may jsut have trouble with displaying coordinates.

Basically, I'm using a Property Set to schedule regular Autocad Objects instead of using the Data Extract feature.

See attached dwg for sample.

Has anyone been sucessful at getting the z-location of objects via VB-Script?
Or can you give suggestion on getting the above code to work within a Formula Definition?

Thanks!
Kelley