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?
Solved! Go to Solution.
Solved by jeremytammik. Go to Solution.
Solved by FAIR59. Go to 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.
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
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
Dear James,
Congratulations for solving the task and thank you for letting us know and sharing your approach!
Our pleasure entirely 🙂
Cheers,
Jeremy
Can't find what you're looking for? Ask the community or share your knowledge.