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 runrule in idw from rule in assembly

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
art_turner
2814 Views, 3 Replies

Ilogic runrule in idw from rule in assembly

 

 i just want to run a rule in an IDW from a rule in an IAM.

 

ASSY1.IAM Rule 1 which in turn runs ASSY1.IDW Rule2

 

something like this(which doesnt work)

 

strfolder =ThisDoc.Path & "\Assembly1.idw"

iLogicVb.RunRule(strfolder, "sav_idw_as_dwg")

 

the files can be hard coded, have the same name in the same directory. the IDW is open.

 

 

 

 

 

3 REPLIES 3
Message 2 of 4
art_turner
in reply to: art_turner

Seems odd you cannot run a rule in an IDW from a rule in an assembly.

 

How about opening the IDW from the Assembly then running a rule based on the After Open event?

 

then can i Close the IDW in the rule in the IDW or should i close the IDW in the rule in the Assembly?

 

 

Message 3 of 4

Could you please test this sample code in assembly rule:

'open known drawing document specifying full filename
FullFilename = ThisDoc.Path & "\AAA.idw"
Dim oDoc as DrawingDocument = ThisApplication.Documents.Open(Fullfilename)

'run rule in the drawing document
auto = iLogicVb.Automation
auto.RunRule(oDoc, "IDW_Rule")

'you may also save and close this drawing document
'oDoc.Save
'oDoc.Close

Some operations can be completed in invisible mode (this is faster).  If this applicable open the drawing document wirh argument Visible = False:

Dim oDoc as DrawingDocument = ThisApplication.Documents.Open(Fullfilename, False)

 Cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 4 of 4

thats it. thank you. that is very useful. also i might add, a little dificult to find anywhere. thanks again.

 

 

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

Post to forums  

Autodesk Design & Make Report