
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am having an interesting issue when it comes to automating my Center Dimension Texts on my drawings. Right now I am trying to incorporate this line of code into my iLogic rules:
Dim oDrawDoc As DrawingDocument
Dim oSheet As Sheet = oDrawDoc.ActiveSheet Dim oDrawingDim As DrawingDimension For Each oDrawingDim In oSheet.DrawingDimensions If TypeOf oDrawingDim Is LinearGeneralDimension Or _ TypeOf oDrawingDim Is AngularGeneralDimension Then Call oDrawingDim.CenterText End If Next
Here is a screenshot of what it looks like after I have run the rule.
I do not get any errors with this, but it just doesn't exactly center it, I can tell it semi works, because I have moved dimensions crazily and run the rule and it pushes it to this location. The weird thing is that we have a plug-in that does this using this code:
Dim oDoc As Inventor.DrawingDocument = Nothing oDoc = g_inventorApplication.ActiveDocument Dim oDrawingView As Inventor.DrawingView = Nothing Dim oSheet As Inventor.Sheet oSheet = oDoc.ActiveSheet For Each oDrawingDim In oSheet.DrawingDimensions If TypeOf oDrawingDim Is LinearGeneralDimension Or TypeOf oDrawingDim Is AngularGeneralDimension Then Call oDrawingDim.CenterText End If Next
Now when I click this button once, it does nothing. However, if I click it TWICE it works:
It is kind of peculiar why I have to run this button twice to get it to work. But, I thought maybe if I just placed the code twice in the iLogic rule, maybe it would simulate the same thing. It did not end up working that way. Does anyone have any suggestions? Or maybe there is another way to code this same function that I can try.
Solved! Go to Solution.