Matchlines - Access gemotry/length/coordinates?

Matchlines - Access gemotry/length/coordinates?

wils02
Enthusiast Enthusiast
1,601 Views
2 Replies
Message 1 of 3

Matchlines - Access gemotry/length/coordinates?

wils02
Enthusiast
Enthusiast

All,

 

Let's start by saying I have researched this topic to the best of my ability and it dead ends quick...The most I can see is maybe some geometry property on the matchline?

 

To give a little background, matchlines are used to show how a view/floor is broken up into smaller views to be placed on sheets. So a sheet may show an overall floor plan with matchlines dividing up the whole building and view references to the corresponding sheet of each individual sheet. 

 

I guess I have a few questions:

 

  1. Is it possible to get the length and (x0, y0, x1, y1) coordinates of matchlines in the project?
  2. If not, is there a property of the view itself knowing where it is split by a matchline?
  3. If (1) is possible, I'm really at a loss to understand how to follow the matchline in the Revit API docs. Can someone help me understand how the matchline is represented in the API?

 

wils

0 Likes
1,602 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk

Just like you, I do not know exactly how a matchline is represented in the Revit database.

 

You can discover that for yourself by following the standard steps to research how to solve a Revit API programming task; in short, create the object of interest manually in the user interface and use RevitLookup and other tools to explore what changed in the database:

 

 

Once you know what database elements represents the matchline, you can explore its properties, relationships and geometry, and things will become much clearer.

 

Looking forward to hearing what you find out.

 

Thank you!

  

Best regards,

 

Jeremy

 



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

0 Likes
Message 3 of 3

FAIR59
Advisor
Advisor

As so often with elements defined by sketchlines, you can't get the sketch direcly, but you have to use the Temporary Transaction Trick to get access to the sketchlines.

StringBuilder sb = new StringBuilder();
Element elem; // MatchLine - element
List<ElementId> deleted = new List<ElementId>();
using (Transaction t = new Transaction(doc,"dummy"))
{
	t.Start();
	deleted = doc.Delete(elem.Id).ToList();
	t.RollBack();
}
List<ModelCurve> sketchLines = new List<ModelCurve>(); foreach(ElementId id in deleted) { Element e = doc.GetElement(id); if (!(e is ModelCurve)) continue;
sketchLines.Add( e as ModelCurve); sb.AppendLine(string.Format("<{0}> {1} {2}",id,e.Name, e.GetType())); } TaskDialog.Show("debug",sb.ToString());