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: 

MultiSegmentGrid start end problem

2 REPLIES 2
Reply
Message 1 of 3
pkhlineworks
402 Views, 2 Replies

MultiSegmentGrid start end problem

Is there a way to figure out which grid segment is the start of a MultiSegmentGrid and which is the end? I've noticed the GetGridIds function returns an unordered list of element id's. I don't think checking which grids only have an unjoined start point will work because both the start and end grid could have unjoined start points depending on how the user drew them.

 

2 REPLIES 2
Message 2 of 3
jeremytammik
in reply to: pkhlineworks

Dear Paul,

 

Thank you for your query.

 

I am sorry to say that I do not know off-hand, nor can I figure anything out, not having anything tangible to start from.

 

I do not even know what the ‘start’ and the ‘end’ of a MultiSegmentGrid might be.

 

How would you define that?

 

Just from looking at the Revit API help file description of the MultiSegmentGrid, though, I see that "this element acts as a multi-segmented Grid. The individual grids associated to the MultiSegmentGrid behave as a single unit and all share the same text. They inherit their type (GridType) from the MultiSegmentGrid."

 

Using the MultiSegmentGrid.GetMultiSegementGridId method, you can determine the relationships back and forth between a MultiSegmentGrid and its member grids.

 

Since each member grid is a normal Revit element, I assume it has a location and bounding box.

 

If your definition of 'start' and end' has anything whatsoever to do with geometry, such as location, X and Y coordinates, etc., then this information enables you to implement whatever sorting and start and end identification you like.

 

To summarise:

 

  • Retrieve the member grids.
  • Determine each member grid location.
  • Sort the member grids by location.
  • Voila: you have the start and end grid.

 

I hope this helps.

 

Best regards,

 

Jeremy



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

Message 3 of 3
pkhlineworks
in reply to: jeremytammik

What I'm trying to determine is which end the grid head will be drawn on by default. The grid type allows a user to show a grid head on the start or end of a grid line. With a single segment line this is easy to see but for a multi-segment grid line it is not as easy.

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community