Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using the "Copy Properties" function in a drawing

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Hubert_Los
217 Views, 1 Reply

Using the "Copy Properties" function in a drawing

Hubert_Los
Advocate
Advocate

Hi,

How to copy dimension properties to another dimension?

Hubert_Los_0-1684182649552.png



Thank you for all your help 

0 Likes

Using the "Copy Properties" function in a drawing

Hi,

How to copy dimension properties to another dimension?

Hubert_Los_0-1684182649552.png



Thank you for all your help 

1 REPLY 1
Message 2 of 2
JelteDeJong
in reply to: Hubert_Los

JelteDeJong
Mentor
Mentor
Accepted solution

There is no easy API call o do the same. But you can copy each property individually from one to the other. something like this:

Dim dimension1 As LinearGeneralDimension = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingDimensionFilter, "")
Dim dimension2 As LinearGeneralDimension = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingDimensionFilter, "")

dimension2.Style = dimension1.Style
dimension2.Layer = dimension1.Layer
dimension2.Text.FormattedText = dimension1.Text.FormattedText
dimension2.Precision = dimension1.Precision
dimension2.IsInspectionDimension = dimension1.IsInspectionDimension
dimension2.FirstArrowheadType = dimension1.FirstArrowheadType
dimension2.SecondArrowheadType = dimension1.SecondArrowheadType
dimension2.ArrowheadsInside = dimension1.ArrowheadsInside

But not all dimension types have the same properties therefore when a user (or code) selects a dimension you need to know what kind of dimension you are dealing with. And act according to that.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes

There is no easy API call o do the same. But you can copy each property individually from one to the other. something like this:

Dim dimension1 As LinearGeneralDimension = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingDimensionFilter, "")
Dim dimension2 As LinearGeneralDimension = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingDimensionFilter, "")

dimension2.Style = dimension1.Style
dimension2.Layer = dimension1.Layer
dimension2.Text.FormattedText = dimension1.Text.FormattedText
dimension2.Precision = dimension1.Precision
dimension2.IsInspectionDimension = dimension1.IsInspectionDimension
dimension2.FirstArrowheadType = dimension1.FirstArrowheadType
dimension2.SecondArrowheadType = dimension1.SecondArrowheadType
dimension2.ArrowheadsInside = dimension1.ArrowheadsInside

But not all dimension types have the same properties therefore when a user (or code) selects a dimension you need to know what kind of dimension you are dealing with. And act according to that.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report