Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Exclude from print if Model iProperty exists

2 REPLIES 2
Reply
Message 1 of 3
dliteful
264 Views, 2 Replies

Exclude from print if Model iProperty exists

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.

2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: dliteful

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

****
Message 3 of 3
chandra.shekar.g
in reply to: Anonymous

@dliteful ,

 

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,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report