Get Coordinates of Adaptive Component Placement Point and Shape Handle points

Get Coordinates of Adaptive Component Placement Point and Shape Handle points

Anonymous
Not applicable
4,097 Views
4 Replies
Message 1 of 5

Get Coordinates of Adaptive Component Placement Point and Shape Handle points

Anonymous
Not applicable

We are trying to develop a dynamo script which will extract the point coordinates of an adaptive component placement point and the defines shape handle points.

In a python script node we can obtain the element ID as follows:

 

for elem in adaptComp:
adaptPoints = AdaptiveComponentInstanceUtils.GetInstancePlacementPointElementRefIds(elem)
output.append(adaptPoints)

 

Feeding this element ID into the AdaptiveComponent.Location node in dynamo gives us the point coordinates for the Placement point however, there does not seem to be a similar node to extract the geometry for the shape handles. 

 

Feeding the element ID into the Clockwork Element.Location+ node also fails to retrieve the point geometry for the shape handles.

 

Is there a way in which the adaptive point shape handle point location can be returned in by python.

 

What would the python script be for the equivalent of the AdaptiveComponent.Location node and how would this be adapted for the shape handles?

0 Likes
Accepted solutions (3)
4,098 Views
4 Replies
Replies (4)
Message 2 of 5

FAIR59
Advisor
Advisor
Accepted solution

I have no experience programming for Dynamo, but using the API you get the shapehandle points as follows : 

AdaptiveComponentInstanceUtils.GetInstanceShapeHandlePointElementRefIds(inst)

 

shapehandle points and placementpoints are both of class ReferencePoint, so finding the location should be the same. 

0 Likes
Message 3 of 5

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear James,

 

Thank you for your query, and many thanks to Fair59 for his helpful answer and suggestion to use the AdaptiveComponentInstanceUtils class.

 

Here are some other threads discussing examples of using it:

 

 

I hope this helps.

 

Best regards,

 

Jeremy

  



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 4 of 5

Anonymous
Not applicable
Accepted solution

Thanks Guys - This solved the problem for us.

 

The placement point coordinates were required as well as the shapehandle and we obtained them using the respective GetInstance to obtain their element ID's.

 

WE then got the coordinates of the Element ID's and finally flattened the list to a list of oordinates which maintained the correct order by finding the placement point first followed by the shapehandles.

 

Thanks for your help.

Rgards

JamesL

0 Likes
Message 5 of 5

jeremytammik
Autodesk
Autodesk

Dear James,

 

Congratulations for solving the task and thank you for letting us know and sharing your approach!

 

Our pleasure entirely 🙂

 

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes