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: 

ilogic settitleblock activesheet compile error from part

2 REPLIES 2
Reply
Message 1 of 3
a_phipps
597 Views, 2 Replies

ilogic settitleblock activesheet compile error from part

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.

2 REPLIES 2
Message 2 of 3
adam.nagy
in reply to: a_phipps

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
Autodesk Platform Services
Message 3 of 3
VdVeek
in reply to: adam.nagy

@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.

Autodesk Inventor 2015 Certified Professional & Autodesk Inventor 2012 Certified Professional.

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

Post to forums