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: 

Is there a function similar to "DLxCopyDimPropertiesCmd"? (Copy Properties - Drawing)

3 REPLIES 3
Reply
Message 1 of 4
Hubert_Los
181 Views, 3 Replies

Is there a function similar to "DLxCopyDimPropertiesCmd"? (Copy Properties - Drawing)

Hello,

I would like find function in iLogic similar to "DLxCopyDimPropertiesCmd"?

Hubert_Los_0-1722925785984.png


OR
Is it possible to put information to "DLxCopyDimPropertiesCmd" function, in this case putting the reference dimension and the dimension to which the values are to be copied?

OR
Selecting the dimension by code, after calling the command "DLxCopyDimPropertiesCmd".

3 REPLIES 3
Message 2 of 4
AndrewHumiston
in reply to: Hubert_Los

Are you trying to turn a specific dimension into a reference? for instance by clicking on it? here is the code snippet for doing so. you run the code and select the dimension to set to reference.

 

While True
	'select a dimension line and set the filter to dimension
	Dim oDim As DrawingDimension = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingDimensionFilter, "Select Drawing Dimension...")

	'if nothing exit while
	If IsNothing(oDim) Then Exit Sub
		oDim.Tolerance.SetToReference
End While
Message 3 of 4
WCrihfield
in reply to: Hubert_Los

Hi @Hubert_Los.  The short answer is no.  There is no Inventor API or iLogic API method equivalent to executing that command and using that dialog to copy dimension properties from one dimension to one or more others.  We would have to create our own routine for handling that task.  The task it is doing does not sound that difficult to simulate though, without the dialog being involved.  We can access all of those properties of a dimension by code, so technically we should be able to store a reference to the 'source' dimension in a variable, then when accessing those properties of the 'destination' dimensions, just use the source dimension property value to set the property value of the destination one.  It likely will not be quite as simple as it sounds, because some of those, like tolerance & inspection may not be as simple as a single setting, but it does sound possible to achieve the same results by code.

 

As far as your last couple comments...you could try playing around with the Document.SelectSet and its methods for making sure a source dimension is selected before the command gets executed.  But since this command was designed for use in the user interface, with manual user input & selections, I am not sure how the following selections (the dimensions to copy properties to) would need to be handled.  As far as the other settings related to that command, you can play around with the 'PostPrivateEvent' and its similar methods.  There is an old Sample code (Link) which shows how to use it, but the code is in VBA, instead of iLogic/vb.net.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 4 of 4
Hubert_Los
in reply to: AndrewHumiston

@AndrewHumiston 
I would like to copy all the properties from another dimension (reference dimension), rather than changing the dimension to a reference type.
The naming may have been confusing

@WCrihfield 
I will check "PostPrivateEvent" or create code that copies step by step all properties.

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

Post to forums  

Autodesk Design & Make Report