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

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

kixxxxxyz
Explorer Explorer
525 Views
5 Replies
Message 1 of 6

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

kixxxxxyz
Explorer
Explorer

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.

0 Likes
Accepted solutions (1)
526 Views
5 Replies
Replies (5)
Message 2 of 6

A.Acheson
Mentor
Mentor
Accepted solution

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
0 Likes
Message 3 of 6

CGBenner
Community Manager
Community Manager

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

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!


Chris Benner
Community Manager

0 Likes
Message 4 of 6

kixxxxxyz
Explorer
Explorer


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

0 Likes
Message 5 of 6

A.Acheson
Mentor
Mentor

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

jcdsaballas35CNE
Explorer
Explorer

 

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

0 Likes