Community
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.
Sample rule is attached.
Solved! Go to Solution.
Solved by dgreatice. Go to Solution.
Change
ThisDrawing to ThisDoc
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,
Thanks a lot. It is doing well.
I appreciate your hep.
@dgreatice wrote:Change
ThisDrawing to ThisDoc
lp.
Can't find what you're looking for? Ask the community or share your knowledge.