Set and keep dimension distance to views

Set and keep dimension distance to views

Anonymous
Not applicable
882 Views
4 Replies
Message 1 of 5

Set and keep dimension distance to views

Anonymous
Not applicable

Hi all,

 

How can I get my dimensions to keep their distance to the view when I change the size of the geometry? Right now, when I increase the size of my part, the dimensions "go into" the view, and when I decrease it, they move too far away from the view. It would be nice to have them "in place" when I make changes to geometry.

 

Best regards,

 

Espen

0 Likes
883 Views
4 Replies
Replies (4)
Message 2 of 5

HermJan.Otterman
Advisor
Advisor

could you do it manualy with arrange? would that give you a good result?

if so than you can do that also with code.

 

'Create object collection for arrange

Dim oArrangeCollection As ObjectCollection

oArrangeCollection = Thisapplication.TransientObjects.CreateObjectCollection

'Place dimensions

Dim oLineareDim As LinearGeneralDimension = DrawlinearDimension(lstLowestObjects(0), lstHighestObjects(0))

oArrangeCollection.Add(oLineareDim)

oLineareDim = DrawlinearDimension(lstLeftObjects(0), lstRightObjects(0))

oArrangeCollection.Add(oLineareDim)

'arrange

Dim osheet As Sheet = oDrawingView.Parent

osheet.DrawingDimensions.Arrange(oArrangeCollection)

 

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


Message 3 of 5

rikard.nilsson
Collaborator
Collaborator
Hi Espen,

My suggestion is that you place the dimensions as a distance from view border. Then your dimensions always is outside the view.
You can get the center, width and height of the view and after that it's only math.

/Rikard
0 Likes
Message 4 of 5

Anonymous
Not applicable

Thank you both for your replies!

 

Rikard, this is what I want to do but cant figure out how to do 🙂 The dimensions are created "the normal way". How can I:

 

a) Sort the dimensions I want to position from the rest? How do I  search for them and sort them in a collection?

B) How do I place them? I can't see that there's a Position property in the General Dimension object?

 

Espen

0 Likes
Message 5 of 5

rikard.nilsson
Collaborator
Collaborator

Hi,

 

If I understod you right. You have the dimensions create manually before yo try to move them with code..

 

a) It can be quite hard to find the right ones and after that sort them. What I would do is to create some layers and place the dimensions on different layers. And then search for the dimension on specific layers. If you give them different names then you know where each dimension to move first..

 

b) dimension.Text.Origin is the one you use to move it when it's already placed in the drawing..

 

 

One other way to solve this is to add dimensions dynamiclly to the drawing one by one.. But that is more programming I think..But not that hard to solve..

 

/Rikard