To build up rule commomn for Part, Assembly and Drawing Documents

RoyWickrama_RWEI
Advisor
Advisor

To build up rule commomn for Part, Assembly and Drawing Documents

RoyWickrama_RWEI
Advisor
Advisor

I need to run some of my rules in part, assembly and drawing documents. But I could never do it despite I spend a lot of time. It runs for drawings only and gives error shown below for other documents.

Capture July1st.PNG

Post_July1st.png

Sample rule is attached.

0 Likes
Reply
Accepted solutions (1)
406 Views
3 Replies
Replies (3)

dgreatice
Collaborator
Collaborator
Accepted solution

Change

 

ThisDrawing to ThisDoc

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014

chandra.shekar.g
Autodesk Support
Autodesk Support

@RoyWickrama_RWEI,

 

Try below iLogic code.

 

Sub Main()
	oRuleNo = "RULE NO: iL0071"
	'Dim oDoc As DrawingDocument
	'oDoc = ThisApplication.ActiveDocument
	oDoc = ThisApplication.ActiveDocument
	'check file type
		 
	If oDoc.DocumentType = DocumentTypeEnum.kDrawingDocumentObject Then
		MessageBox.Show("Drawing document!", oRuleNo)
		oProcess_Dwg()
	End If


	If oDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
		MessageBox.Show("ASSEMBLY Document!", oRuleNo)
		oProcess_Assy()
	End If

	If oDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
		MessageBox.Show("PART Document!", oRuleNo)
		oProcess_Part()
	End If 
	 
End Sub

Sub oProcess_Dwg()
	oModelDoc = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName) 
End Sub

Sub oProcess_Assy()

End Sub

Sub oProcess_Part()


End Sub

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



RoyWickrama_RWEI
Advisor
Advisor

Thanks a lot. It is doing well.

I appreciate your hep.


@dgreatice wrote:

Change

 

ThisDrawing to ThisDoc



lp.

0 Likes