Skip to main content

Hello everybody!

I try to solve one big problem... I work with workspace which export some spatial data and all I need to do is to create envelope around exported data. BUT, I need the envelope which is composed by predefined AUTOCAD BLOCK in separate DWG drawing (e.g. frame or drawing stamp; block is everytime centered into 0,0 coordinates)... To better imagination I attached picture, where I decribed my aim.

I would appreciate every help.

Thank You so much!

Lubo

Hi @lazarlubomir,

You can use the BoundingBoxAccumulator on a copy of your data to get the bounding rectangle, then use its location and size to determine the scale and placement point of the block.

For example, to get the placement point:

placement x = (xmin + xmax) / 2
placement y = (ymin + ymax) / 2

As an alternative to placing the frame block in the Model space, you could put in a Paper Space instead, and automatically create a viewport from your data. Please see the following article for more details:

Working with AutoCAD Layouts


Thank You so much @DaveAtSafe, it works!


Reply