MultiSegmentGrid start end problem

MultiSegmentGrid start end problem

Anonymous
Not applicable
684 Views
2 Replies
Message 1 of 3

MultiSegmentGrid start end problem

Anonymous
Not applicable

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.

 

0 Likes
685 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk

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

0 Likes
Message 3 of 3

Anonymous
Not applicable
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.
0 Likes