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: 

Component was not found - That's good!

1 REPLY 1
Reply
Message 1 of 2
MarkESmith
310 Views, 1 Reply

Component was not found - That's good!

I'm using replace on a sub assembly but want to write a parameter change to all the parts in the sub assembly as & when they appear.

An error occurs when I try to write a parameter to a part which isn't in the sub assembly - makes sense but how do work around this?

 

First try was this:

If Component.IsActive("SS_12.5mm Insln:1") = True  Then Parameter("SS_12.5mm Insln:1", "Material") = Insulation


but "SS_12.5mm Insln:1" isn't here (by design) - I want a Component.Exists type comand - possible?
1 REPLY 1
Message 2 of 2
jdkriek
in reply to: MarkESmith

Try this 😉

 

(Try, Catch, End Try)

 

Try
	If Component.IsActive("SS_12.5mm Insln:1") = True Then 
		Parameter("SS_12.5mm Insln:1", "Material") = Insulation
	Else
		MsgBox("part is not active")
	End If
Catch
	'Assume part does not exist
	MsgBox("part does not exist")
End Try
Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


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

Post to forums  

Autodesk Design & Make Report