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.
Solved! Go to Solution.
Solved by A.Acheson. Go to 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)
@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!
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
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.
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.