Is there any ilogic code for the save and replace component button in Productivity?
I want to place a hinge assembly into an assembly then replace that hinge assembly with a new filename.
Solved! Go to Solution.
Solved by HermJan.Otterman. Go to Solution.
Hello,
Look at this link
http://modthemachine.typepad.com/my_weblog/2009/03/running-commands-using-the-api.html
The command name to use is : "AssemblyBonusTools_SaveAndReplaceComponentCmd"
put this in a iLogic rule:
' Get the CommandManager object.
Dim oCommandMgr As CommandManager
oCommandMgr = ThisApplication.CommandManager
' Get control definition for the line command.
Dim oControlDef As ControlDefinition
oControlDef = oCommandMgr.ControlDefinitions.Item( _
"AssemblyBonusTools_SaveAndReplaceComponentCmd")
' Execute the command.
oControlDef.Execute
It will start the command, now you have to select and name the part..
The code working good to select parts in assembly or and sub assembly but, does someone know if it's possible to select an assembly with the save and replace by using a simililar Ilogic
not sure what you mean?
where should the assembly be selected from?
I mean select a sub assembly in the main assembly to save and replace.
If we select a sub assembly in tree and then click on command save and replace, the command let us save and repplace the sub.
But if we call the command first the only choice the command give is to select parts, no sub
Actually, if you saveas using:
doc.SaveAs newname, False
then if file is member of assembly, and that assembly is opened then it is replaced without any further functions or procedures... it works for *.ipt, and*.iam files.
if you dont want to replace use:
doc.SaveAs newname, True
true/false means that you saveascopy or not.
In the graphic window, you can select parts, but in the Browser you can select an sub assembly...
This snippet of code works flawlessly. The only downside is I have to manually select the parts. Is there a possibility to select several parts in the code to execute the save and replace function for?
I've been searching all over the internet but there's little to be found regarding de Save and replace function.
Can't find what you're looking for? Ask the community or share your knowledge.