Community
Love the iLogic Batch print to PDF from assembly, but I've been asked to exclude certain file types that contain the Model iProperty Value of "SPA" under the Summary Tab in Category field.
Any help would be greatly appreciated.
Attached is the code I'm using.
put somthing like this in your code when you open a idw. I use this for something similar
For Each oOcc In oLeafOccs 'this is your code oDoc = oOcc.Definition.Document ' not new Dim emodel As String = oDoc.DisplayName 'use this ex = Right(emodel,4) 'with this are you sure you have a ex If ex <> ".ipt" emodel = emodel & ".ipt" End If eTest= Left(iProperties.Value(emodel,"summary","category"),6) 'here you can make a if statement If eTest <> "Laser" Then
****
Hoping that below iLogic code helps to exclude components which contains "SPA" Summary Category.
Dim oAsmDoc As AssemblyDocument oAsmDoc = ThisApplication.ActiveDocument oAsmName = Left(oAsmDoc.DisplayName, Len(oAsmDoc.DisplayName) -4) 'check that the active document is an assembly file If ThisApplication.ActiveDocument.DocumentType <> kAssemblyDocumentObject Then MessageBox.Show("Please run this rule from the assembly file.", "iLogic") Exit Sub End If For Each oRefDoc In oAsmDoc.AllReferencedDocuments Dim oCategory As String oCategory = oRefDoc.PropertySets.Item("Inventor Summary Information").Item("Category").Value If oCategory <> "SPA" Then Call PDFAddIn.SaveCopyAs(oDrawDoc, oContext, oOptions, oDataMedium) End If Next
Thanks and regards,
Can't find what you're looking for? Ask the community or share your knowledge.