Hello,
I wish to create a form that with multiple buttons. Each button will place another component (platform, stairs, ladder, railing)
I wish to place them using 'Place iLogic Component"
I know you can call this command by:
ThisApplication.CommandManager.ControlDefinitions.Item("iLogic.PlaceComponent").Execute
But is it possible to automatically browse to and open a file this way using a path "C:\CPSVault\PlatformComponents\Stairs.iam" within this command?
Thanks in advance,
Arnold
Solved! Go to Solution.
Solved by adam.nagy. Go to Solution.
I feel like this blog post might hold the solution to this problem : http://adndevblog.typepad.com/manufacturing/2013/01/provide-command-parameters-using-postprivateeven...
Thanks for helping me so far.
I manage to get a component placed using iLogic
oPath = ThisDoc.Path & "\"
oFile = "part.ipt"
Dim cm As CommandManager
cm = ThisApplication.CommandManager
cm.PostPrivateEvent(PrivateEventTypeEnum.kFileNameEvent, oPath & oFile)
Dim cd As ControlDefinition
cd = cm.ControlDefinitions("iLogic.PlaceComponent")
'cd = cm.ControlDefinitions("AssemblyPlaceComponentCmd")
cd.Execute
But when I enter the place ilogic component window, the code continues to run while still in the ilogic dialog.
I wish the user to first select OK button, and place the part (only once) in the assembly.
Is this possible to 'delay' the rule till the user has placed a part in the assembly?
Secondly: Is it possible to cancel placing another occurrence? (like user pressing escape after placing first)
Thanks in advance,
Arnold
Hi Arnold,
I think you're starting to run into the limitations of iLogic.
Using Execute2(True) you can run a command synchronously, however, I think because there is too much going on in case of the iLogic Place command (a new document and a dialog pop up) it will still run asychronously.
"AssemblyPlaceComponentCmd" on the other hand can be run synchronously using Execute2(True)
What exactly is it that you really need from the iLogic Place command? - showing the part document that is being placed or showing the parameters?
Maybe there would be some other way to do it.
Cheers,
Sorry for my late response, this is a side project of mine.
im trying to create an environment where you can easily add ladders and catwalks copies.
icopy and place ilogic components both create a new instance of the assembly (like copy design)
But they have some limitations in my situation, I will try "AssemblyPlaceComponentCmd" but have to figure out how to make new instances. That will be a lot of programming i guess.
Thx for the tips so far
Hi Arnold,
You can copy the files with new names/new locations using the .NET API or Inventor's FIleManager, and then update the references in the files using ReplaceReference: http://adndevblog.typepad.com/manufacturing/2012/08/replace-the-file-reference-by-inventor-api.html
I hope this helps.
Cheers,