
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I have a drawing document that has a rule "DRAWINGPROCESS" and within that rule I am calling the CommandManager to arrange dimensions :
Dim oSelectSet As SelectSet = oDoc.SelectSet oSelectSet.Clear For Each oDrawingDim In oSheet.DrawingDimensions oSelectSet.Select(oDrawingDim) Next Dim oPropContDef2 As ControlDefinition = ThisApplication.CommandManager.ControlDefinitions.Item("DrawingArrangeDimensionsCmd") Call oPropContDef2.execute
The code works fine when I run the rule manually in the drawing document.
However, I actually trigger the rule from an assembly document through iLogic.Automation
So from the assembly document I :
- Open the drawing document
- Pass some iProperties into the document
- Run the "DRAWINGPROCESS" rule in the document
The code runs OK and doesn't error out BUT the Arrange Dimensions Command doesn't get executed, I put some message boxes in around the line that executes the command I can see that the dimensions are selected but are never arranged (see images attached)
I also did another test, I created a new rule in my drawing document to do the following :
Dim iLogicAuto As Object = iLogicVb.Automation If (iLogicAuto Is Nothing) Then Exit Sub Dim doc As Document = ThisApplication.ActiveDocument Dim ruleName As String = "DRAWINGPROCESS" Dim rule As Object = iLogicAuto.GetRule(doc, ruleName) Dim i As Integer = iLogicAuto.RunRuleDirect(rule)
This code also runs OK but fails to run ArrangeDimensionsCmd.
And finally, if I create a new rule in the drawing doc and do :
iLogicVb.RunRule("DRAWINGPROCESS")
Everything works OK - the ArrangeDimensionsCmd is fired.
All of the above leads me to the conclusion that it's the iLogic.Automation that is stopping the command being executed.
If this is the case is there a workaround I can use to get this to work ?
If not, where am I going wrong?!
Thanks,
Tom
Solved! Go to Solution.