Place Components with Imates by VBA

Place Components with Imates by VBA

Anonymous
Not applicable
728 Views
5 Replies
Message 1 of 6

Place Components with Imates by VBA

Anonymous
Not applicable
Our end product is a combination of several assemblies which are placed on (composit)Imates.
It is no problem to realize this manually.
Our vba-programmer tries to place the assemblies by a program, but he doesn't know how to activate the checkbox "use Imate" (place component).
The command "replace componet" is no problem to program, so we work with dummies which has to be replaced.
This is a workable solution, but what we want to do is to place an assembly in stead of replace the assembly.
Is there a possibility to activate the checkbox "use Imate" by a vba program ?
0 Likes
729 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
HEEEEELP !!!!!!!!!!!!!!11
0 Likes
Message 3 of 6

Anonymous
Not applicable
You should be posting in the Inventor Customization NG. Might have better luck there
anyhow.

--
Kent
Member of the Autodesk Discussion Forum Moderator Program


"boonedam" wrote in message news:f0ca598.0@WebX.maYIadrTaRb...
> HEEEEELP !!!!!!!!!!!!!!11
>
0 Likes
Message 4 of 6

Anonymous
Not applicable
The API does not support this as yet.

 

However a crude method to apply imates when
placing the components through API. Before you insert the
components

atleast once invoke placecomponent command and
check "Use iMate" and cancel the dialog. One of the components
should

be placed through CommandManager as shown (VBA
macro) below.

 

Sub test()
 
    Dim pos
As Matrix
   
    Set pos =
ThisApplication.TransientGeometry.CreateMatrix()
   
pos.SetToIdentity
   
    Dim occ1 As
ComponentOccurrence
    Set occ1 =
ThisDocument.ComponentDefinition.Occurrences.Add("c:\part1.ipt",
pos)
   
    sFname =
"c:\part2.ipt"
     ' Push the filename onto the Inventor
clipboard
    Call
ThisApplication.CommandManager.PostPrivateEvent(kFileNameEvent,
_
                                                            
sFname)
       

            Call
ThisApplication.CommandManager.StartCommand(kPlaceComponentCommand)
End
Sub

Cheers,

-Thilak

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Our
end product is a combination of several assemblies which are placed on
(composit)Imates.
It is no problem to realize this manually.
Our
vba-programmer tries to place the assemblies by a program, but he doesn't know
how to activate the checkbox "use Imate" (place component).
The command
"replace componet" is no problem to program, so we work with dummies which has
to be replaced.
This is a workable solution, but what we want to do is to
place an assembly in stead of replace the assembly.
Is there a possibility
to activate the checkbox "use Imate" by a vba program
?
0 Likes
Message 5 of 6

Anonymous
Not applicable
This should be a part of the API soon!!! This seems
to be what a lot of inventor dealers are tooting their horns about, yet you
can't do anything really cool with it until you open it up in the
API

 

doh!

mike

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

The API does not support this as
yet.

 

However a crude method to apply imates when
placing the components through API. Before you insert the
components

atleast once invoke placecomponent command and
check "Use iMate" and cancel the dialog. One of the components
should

be placed through CommandManager as shown (VBA
macro) below.

 

Sub test()
 
    Dim
pos As Matrix
   
    Set pos =
ThisApplication.TransientGeometry.CreateMatrix()
   
pos.SetToIdentity
   
    Dim occ1 As
ComponentOccurrence
    Set occ1 =
ThisDocument.ComponentDefinition.Occurrences.Add("c:\part1.ipt",
pos)
   
    sFname =
"c:\part2.ipt"
     ' Push the filename onto the
Inventor clipboard
    Call
ThisApplication.CommandManager.PostPrivateEvent(kFileNameEvent,
_
                                                            
sFname)
       

            Call
ThisApplication.CommandManager.StartCommand(kPlaceComponentCommand)
End
Sub

Cheers,

-Thilak

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Our
end product is a combination of several assemblies which are placed on
(composit)Imates.
It is no problem to realize this manually.
Our
vba-programmer tries to place the assemblies by a program, but he doesn't
know how to activate the checkbox "use Imate" (place component).
The
command "replace componet" is no problem to program, so we work with dummies
which has to be replaced.
This is a workable solution, but what we want
to do is to place an assembly in stead of replace the assembly.
Is there
a possibility to activate the checkbox "use Imate" by a vba program
?
0 Likes
Message 6 of 6

Anonymous
Not applicable
Thanks for the suggestion. Does somebody know if placing assemblies with Imaties will be possible in the near future ?
0 Likes