Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get Coordinates of Adaptive Component Placement Point and Shape Handle points

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
3441 Views, 4 Replies

Get Coordinates of Adaptive Component Placement Point and Shape Handle points

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?

4 REPLIES 4
Message 2 of 5
FAIR59
in reply to: Anonymous

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. 

Message 3 of 5
jeremytammik
in reply to: Anonymous

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

Message 4 of 5
Anonymous
in reply to: jeremytammik

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

Message 5 of 5
jeremytammik
in reply to: Anonymous

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report