2D Model drawing size

Experimenter
Experimenter

Hello,

 

I'm looking for a way to get the dimensions of a drawing in 2D Model sheet in VB.NET. I imagine that it would be possible to get the start points and end points of the elements from element properties and then find maximum and minimum x and y coordinates. But I can't quite figure out how to write it and I can't find a good example online either. Should it be done with something like Lines2d collection and GetStartPoint and GetEndPoint methods?

 

Thanks,

Silver Reinart

2 REPLIES

Re: 2D Model drawing size

Valued Contributor
Valued Contributor

Sounds like you are on the right track (max X - min X, max Y - min Y). Not sure if scale would come into play. If it does, you could place a dimension and read the value. That would take care of the scale for you. Or perhaps you could read the scale from the drawing view object.

Terry Tyson
Software Automation Designer

Re: 2D Model drawing size

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom
Hi,
the 2D model in Draft does not have limits or a scale.
If you need to know the max and min coordinate values of some or all objects you have to loop each collection of objects and calculate these values from the range values of each element.
regards

JB
VS2015, SE ST10