- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hi!
i use ThisApplication.CommandManager.ControlDefinitions("PartiFeatureInsertCmd")
and i want to have the name of iFeature selection with ilogic?
Thanks for your help ![]()
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
You can send extra information to a command (if you see it as a selectionset before activating a command)
This page explains alot about the commandmanager
http://modthemachine.typepad.com/my_weblog/2009/03/running-commands-using-the-api.html
And you need something like this
Public Sub PlacePart()
' Get the command manager.
Dim oCommandMgr As CommandManager
Set oCommandMgr = ThisApplication.CommandManager
' Post the filename.
Call oCommandMgr.PostPrivateEvent(kFileNameEvent, _
"C:\Users\ekinsb\Documents\Inventor 2010\Showcasetest.ipt")
' Get control definition for the place component command.
Dim oControlDef As ControlDefinition
Set oControlDef = oCommandMgr.ControlDefinitions.Item( _
"AssemblyPlaceComponentCmd")
' Execute the command.
Call oControlDef.Execute
End Sub
please feel free to "kudos"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
thanks for your reply Frederic!
I see this link before but nothing about what i"m looking for!
Sorry for my English ![]()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The code i try to make!
SyntaxEditor Code Snippet
Dim oDoc As Document Dim oCompDef As PartComponentDefinition oCompDef = ThisApplication.ActiveDocument.ComponentDefinition Dim oiFeatComp As iFeatureComponent ' Get the command manager. Dim oCommandMgr As CommandManager oCommandMgr = ThisApplication.CommandManager 'Get control definition Dim oControlDef As ControlDefinition oControlDef = ThisApplication.CommandManager.ControlDefinitions("PartiFeatureInsertCmd") ' Execute the command synchronously. Call oControlDef.Execute2(True) Dim strPrompt As String strPrompt = oiFeatComp.Name iProperties.Value("Custom", "TEST") = strPrompt
I want the name of iFeature who is selected by the user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
This code does what you where looking for, only you need to create a few lines of code to extract the filename.
now the full path is created in the iproperties.
I found it through debugging in vba, which you wont find easy in help or in ilogic
Dim oDoc As Document
Dim oCompDef As PartComponentDefinition
oCompDef = ThisApplication.ActiveDocument.ComponentDefinition
' Get the command manager.
Dim oCommandMgr As CommandManager
oCommandMgr = ThisApplication.CommandManager
'Get control definition
Dim oControlDef As ControlDefinition
oControlDef = ThisApplication.CommandManager.ControlDefinitions("PartiFeatureInsertCmd")
' Execute the command synchronously.
Call oControlDef.Execute2(True)
Dim oiFeatComp As iFeature
oiFeatComp = oCompDef.Features.iFeatures(oCompDef.Features.iFeatures.Count)
Dim strPrompt As String
strPrompt = oiFeatComp.iFeatureTemplateDescriptor.LastKnownSourceFileName
iProperties.Value("Custom", "TEST") = strPrompt
please feel free to "kudos"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report