Get Solid 3D centroid x coordinate in property definition

Get Solid 3D centroid x coordinate in property definition

Yonas89
Collaborator Collaborator
1,651 Views
3 Replies
Message 1 of 4

Get Solid 3D centroid x coordinate in property definition

Yonas89
Collaborator
Collaborator

Hello,

I'm try to access x property value of solid 3D object centroid property in formula property definition. Could someone tell me what I'm doing wrong here:

Capture.PNG

 

0 Likes
1,652 Views
3 Replies
Replies (3)
Message 2 of 4

Norman_Yuan
Mentor
Mentor

I am no PropertySet expert, but from my tests, it looks like the VB script code used for formula type of property cannot retrieve individual value from an entity's property, if the property is an array. 

 

You can verify this by trying to get 3d solid's Position, instead of Centroid, or trying to define a property set that applies to block reference and then add formula property to get block insertion point's X, or Y, or Z value. Or try to set a formula property against any entity/object's property that is a variant/array.

 

My guess is that this is a flaw when the VB scripting engine is implemented for PropertySet stuff by Autodesk (the VB scripting engine is not the same as used in AutoCAD VBA, because even you do not install VBA in later version of AutoCAD (Civil3D/Architect), PropertySet stuff still works). Pure speculation and I could be wrong, anyway. I am not sure if Autodesk would be fixing this, but most likely not. I am not going to hold my breath.

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 4

Yonas89
Collaborator
Collaborator

hey @Norman_Yuan ,

 

thanks a lot for your reply. You might be just absolutely right. In addition, the whole thing of defining property set formulas is a labyrinth to me. I'm still not sure, which API's I should reference to because sometimes it works and sometimes it does not. Maybe you know some good documentation about scripting in property sets?

0 Likes
Message 4 of 4

gleeuwdrent
Advocate
Advocate

I haven't much experience with it, but this post gives some information about coding in property sets: 

https://autodesk.typepad.com/bimtoolbox/2016/02/autodesk-2016-aec-showreel-call-for-submissions.html

 

Maybe it's helpfull.

0 Likes