Hello,
I would like find function in iLogic similar to "DLxCopyDimPropertiesCmd"?
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".
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
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
(Not an Autodesk Employee)
@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.