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: 

Run a rule in drawing to access the model that is projected and run an external rule to the model

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
kixxxxxyz
278 Views, 5 Replies

Run a rule in drawing to access the model that is projected and run an external rule to the model

In Inventor, how can i create a rule within a drawing file that interacts with the 3D model projected within that drawing. Additionally, how can i execute external rules on the model without actually opening the model interface (example, running them in the background). This is to check the i properties of the model without opening it.

thank you.

5 REPLIES 5
Message 2 of 6
A.Acheson
in reply to: kixxxxxyz

Hi @kixxxxxyz 

See this post here to get the model doc of the view picked, that post is shown below, slightly modifed. You will need to explain what iproperties you want to find and what you want to do with them for further help.   

Dim oView As DrawingView = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select View")
If oView Is Nothing Then Return
	
Dim oModelDoc As Document = oView.ReferencedDocumentDescriptor.ReferencedDocument

Dim oViewModelName As String = oModelDoc.DisplayName
Dim oFullFilePath As String = oModelDoc.FullFileName

MessageBox.Show("DisplayName: " & oViewModelName)
MessageBox.Show("FullFilename: " & oFullFilePath)

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 3 of 6
CGBenner
in reply to: kixxxxxyz

@jericmark_domiquil  Did the information provided by @A.Acheson answer your question? If so, please use Accept Solution so that others may find this in the future. Thank you very much!


Chris Benner
Industry Community Manager – Design & Manufacturing


If a response answers your question, please use  ACCEPT SOLUTION  to assist other users later.


Also be generous with Likes!  Thank you and enjoy!


Become an Autodesk Fusion Insider
Inventor/Beta Feedback Project
Message 4 of 6
kixxxxxyz
in reply to: A.Acheson


thank you for the solution.


What can i add to this rule to run a rule that only runs in an active assembly model.
I want to check its degrees of freedom but it doesnt work.

this is what ive added.

ThisApplication.Documents.Open(oFullFilePath, False)

iLogicVb.RunExternalRule(oFullFilePath, "checker\deg of freed check.iLogicVb")

i dont want the model to open, just the drawing where it is projected.

Thank you so much

Message 5 of 6
A.Acheson
in reply to: kixxxxxyz

Your run external rule method is incorrectly setup. See ilogic api help page here.

You will need to supply a name value map to the rule. See article here.

You could pass in the fullfilename and then open it within the rule in order to get the active document.  

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 6 of 6

 

I dont quite have the knowledge about ilogic and cant understand the article to tweak my current rules. I will do some research for me to understand the details you said.

 

Thank you so much

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report