Hi all
I am trying to change the title block on a idw drawing.
The rule can be started from either the drawing or the part file.
What I am trying to do is update with new part numbers and drawing blank if the user fires the rule from either the drawing or the part.
I managed to do every thing else but not this.
ActiveSheet.SetTitleBlock(stitle,angularTolerance,modelTolerance,featureFeature,featurefold,foldFold,surfaceRoughness,drawingTolerance)
is there a way of setting the title block using 'oDoc' As document as a ref ??
activesheet causes rule not a even to run when started from a part even though the code will never reach it ?
Thanks for any help
Adam.
Hi Adam,
So the rule runs fine from inside the drawing?
ActiveSheet and parameters like that only make sense inside the document where the rule is run from.
There are two ways to solve this problem. Either use the Inventor API from iLogic to get to the drawing doument from the rule running inside the part and set things up from there, or create another rule inside the drawing document which could be called from the part document. You can also pass parameters to rules when you call them.
I hope this helps.
Cheers,
@Adam.nagy, i got almost the same problem as Adam. I created an external Rule that only works in a drawing file. Now if the user runs the rule in an Part file i want to show a nice messagebox but the ActiveSheet command is giving the error window.
Quote from Adam's post: activesheet causes rule not even to run when started from a part even though the code will never reach it ?
How can i prevent iLogic to read thru the code after the Return?
'check that the active document is an Drawing file drawDoc = TryCast(ThisDoc.Document, DrawingDocument) If (drawDoc Is Nothing) Then MessageBox.Show("This rule can only be run in a drawing,", "iLogic") Return End If
Rob.