iLogic Form Button to place ilogic component

iLogic Form Button to place ilogic component

Anonymous
Not applicable
2,645 Views
6 Replies
Message 1 of 7

iLogic Form Button to place ilogic component

Anonymous
Not applicable

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

 

 

 

 

 

 

0 Likes
Accepted solutions (1)
2,646 Views
6 Replies
Replies (6)
Message 2 of 7

MegaJerk
Collaborator
Collaborator

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... 

 

 



If my solution worked or helped you out, please don't forget to hit the kudos button 🙂
iLogicCode Injector: goo.gl/uTT1IB

GitHub
Message 3 of 7

Anonymous
Not applicable

I haven't had time to try this yet

But it looks promising, thanks!

0 Likes
Message 4 of 7

Anonymous
Not applicable

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

 

 

0 Likes
Message 5 of 7

adam.nagy
Autodesk Support
Autodesk Support

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,



Adam Nagy
Autodesk Platform Services
Message 6 of 7

Anonymous
Not applicable

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

0 Likes
Message 7 of 7

adam.nagy
Autodesk Support
Autodesk Support
Accepted solution

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,



Adam Nagy
Autodesk Platform Services