Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Adding an Icon to the assembly panel

16 REPLIES 16
Reply
Message 1 of 17
Anonymous
278 Views, 16 Replies

Adding an Icon to the assembly panel

Ok, I have tried this several diffent ways and to no avail. How do I get the "Assembly Panel" to accept a new Icon? The examples show you how to add an new panel, but I would like to add a new one to the existing panel. TIA, Mike
16 REPLIES 16
Message 2 of 17
Anonymous
in reply to: Anonymous

I could be wrong but given that the API exposes no
method for accessing existing commandbar objects, it does not appear that you
can add a button to the Assembly panel.


--
There are 10 kinds of people. Those who understand binary and
those who don't.

 

http://code.acadx.com
(Pull the pin
to reply)


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Ok,
I have tried this several diffent ways and to no avail. How do I get the
"Assembly Panel" to accept a new Icon? The examples show you how to add an new
panel, but I would like to add a new one to the existing panel. TIA,
Mike
Message 3 of 17
Anonymous
in reply to: Anonymous

There has to be, Kent adds his to the "Part Features" panel the code must be very similar, I'm just missing something. Mike
Message 4 of 17
Anonymous
in reply to: Anonymous

The code for the Addin creation sample in helps adds a toolbutton to the Panelbar sketch
environment. Does that help any?
--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"MDB" wrote in message news:f196d1f.-1@WebX.maYIadrTaRb...
> Ok, I have tried this several diffent ways and to no avail. How do I get the "Assembly
Panel" to accept a new Icon? The examples show you how to add an new panel, but I would
like to add a new one to the existing panel. TIA, Mike
Message 5 of 17
Anonymous
in reply to: Anonymous

I'd just like to if possible drop it on the "Assembly Panel"
Thanks, Mike
Message 6 of 17
Anonymous
in reply to: Anonymous

Mike

Is this a Addin?

Here is from the program I just did which adds a icon to the assembly browser bar.


' Save a reference to the Application object.
Set oApp = AddInSiteObject.Application


Dim oIcon1 As IPictureDisp
Set oIcon1 = LoadResPicture(101, vbResBitmap)

'****** Switch out the next calls / use first for debug and second for release

If InDebug Then
Set oButtonHandler1 =
AddInSiteObject.CreateButtonDefinitionHandler("KWiKDriveCmd1", _
kFileOperationsCmdType, "KWiKDrive", "Constraint Min Max Drive", "Drive")
Else
On Error Resume Next
Set oButtonHandler1 =
AddInSiteObject.CreateButtonDefinitionHandler("KWiKDriveCmd1", _
kFileOperationsCmdType, "KWiKDrive", "Constraint Min Max Drive", "Drive",
oIcon1)
If Err.Number = -2147418113 Then
Set oButtonHandler1 = Nothing
Set oButtonHandler1 =
AddInSiteObject.CreateButtonDefinitionHandler("KWiKDriveCmd1", _
kFileOperationsCmdType, "KWiKDrive", "Constraint Min Max Drive", "Drive")
Err.Clear
On Error GoTo 0
End If
End If

' Set a reference to the environment base collection.
Dim oEnvBaseColl As EnvironmentBaseCollection
Set oEnvBaseColl = oApp.EnvironmentBaseCollection

' Create a new command bar
Dim oCommandBar As CommandBarBase
Set oCommandBar = oEnvBaseColl.CommandBarBaseCollection.Add("KWiKDrive")
' Add a control to the command bar.
Call oCommandBar.Controls.Add(kBarControlButton, _
oButtonHandler1.ControlDefinition)

Dim oAsmCommandBar As CommandBarBase
Set oAsmCommandBar = oEnvBaseColl.CommandBarBaseCollection.Item( _
"AMxAssemblyPanelCmdBar")

' Add a control to the command bar.
Call oAsmCommandBar.Controls.Add(kBarControlButton, _
oButtonHandler1.ControlDefinition)


--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"MDB" wrote in message news:f196d1f.3@WebX.maYIadrTaRb...
> I'd just like to if possible drop it on the "Assembly Panel"
> Thanks, Mike
Message 7 of 17
Anonymous
in reply to: Anonymous

Kent Keller wrote:

> oEnvBaseColl.CommandBarBaseCollection.Add("KWiKDrive") ' Add a
> control to the command bar. Call

MDB,

Note the call to the Add method. This gives you a new ComandBar within a
given environment. It does not allow you to add a button to an existing
CommandBar. This is what I was referring to.

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
Message 8 of 17
Anonymous
in reply to: Anonymous

Kent, the addin section adds another command bar to the Assembly Panel, I guess, as Frank pointed out it is not available (yet) to allow additional controls to the Assembly toolbar itself.



br>Unless Brian has a way of doing it I have not figured it out yet.



Frank and Kent

Thanks,

Mike
Message 9 of 17
Anonymous
in reply to: Anonymous

I guess I am not following. In my mind the Assembly Panel is a toolbar..... i.e. go to
customize, Toolbars, select Assembly Panel and "Show"



What other Assembly bar are you talking about?

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"MDB" wrote in message news:f196d1f.6@WebX.maYIadrTaRb...
> Kent, the addin section adds another command bar to the Assembly Panel, I guess, as
Frank pointed out it is not available (yet) to allow additional controls to the Assembly
toolbar itself.
>
> br>Unless Brian has a way of doing it I have not figured it out yet.
>
> Frank and Kent
> Thanks,
> Mike
Message 10 of 17
Anonymous
in reply to: Anonymous

Kent Keller wrote:
> I guess I am not following. In my mind the Assembly Panel is a
> toolbar..... i.e. go to customize, Toolbars, select Assembly Panel
> and "Show"

While you can add your own panels to a given environment, MDB is wanting
to add a buton to an existing panel (i.e. "Assembly Panel", "Tube &
Pipe"). I do not think this is possible but would love to be proven
wrong.

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
Message 11 of 17
Anonymous
in reply to: Anonymous

Here is an example of adding toolbuttons a new toolbar and the assembly
panel bar. The following code is in the ApplicationAddInServer_Activate
procedure. (watch for word wrap)

- Note that the images in this code are loaded from a resourse file.
- A public constant has been declared: kErrorDebugMode = -2147418113
- The error handler enables text display in place of the icons when
debugging the add-in.




Dim oIcon1 As IPictureDisp
Dim oIcon2 As IPictureDisp

Set oIcon1 = LoadResPicture(102, vbResIcon)
Set oIcon2 = LoadResPicture(103, vbResIcon)

'get a reference to the IV application object
Set m_oIVApp = AddInSiteObject.Application

On Error Resume Next
Set oButtonHandler1 =
AddInSiteObject.CreateButtonDefinitionHandler("AnimatorV4Cmd1", _
kFileOperationsCmdType, "Animate", "Animator 4", "Animate", oIcon1,
oIcon2)
If Err.Number = kErrorDebugMode Then
Set oButtonHandler1 = Nothing
Set oButtonHandler1 =
AddInSiteObject.CreateButtonDefinitionHandler("AnimatorV4Cmd1", _
kFileOperationsCmdType, "Animate", "Animator 4", "Animate")
Err.Clear
On Error GoTo 0
End If

'set a reference to the environment base collection
Dim oEnvBaseColl As EnvironmentBaseCollection
Set oEnvBaseColl = m_oIVApp.EnvironmentBaseCollection

'create a new command bar
Dim oCommandBar As CommandBarBase
Set oCommandBar = oEnvBaseColl.CommandBarBaseCollection.Add("Animator")
'add a button to the new command bar
Call oCommandBar.Controls.Add(kBarControlButton,
oButtonHandler1.ControlDefinition)

'get a reference to the assembly panel bar
Dim oAsmCommandBar As CommandBarBase
Set oAsmCommandBar =
oEnvBaseColl.CommandBarBaseCollection.Item("AMxAssemblyPanelCmdBar")
'add a button to the Assembly panel bar
Call oAsmCommandBar.Controls.Add(kBarControlButton,
oButtonHandler1.ControlDefinition)





Hope this helps some,

Neil



"Frank Oquendo" wrote in message
news:EE6433BABDE26E9CDDD161DABBB69C8F@in.WebX.maYIadrTaRb...
> Kent Keller wrote:
> > I guess I am not following. In my mind the Assembly Panel is a
> > toolbar..... i.e. go to customize, Toolbars, select Assembly Panel
> > and "Show"
>
> While you can add your own panels to a given environment, MDB is wanting
> to add a buton to an existing panel (i.e. "Assembly Panel", "Tube &
> Pipe"). I do not think this is possible but would love to be proven
> wrong.
>
> --
> There are 10 kinds of people. Those who understand binary and those who
> don't.
>
> http://code.acadx.com
> (Pull the pin to reply)
>
>
Message 12 of 17
Anonymous
in reply to: Anonymous

That is what the Code that I posted and Neil posted now does.

Here is my assembly panel bar, the last 5 icons on the right were added
by Addins using the same basic code as what I posted.


--
Kent Keller
http://www.MyMcad.com/KWiK/Mcad.htm

Assistant Moderator
Autodesk Discussion Forum Moderator Program

"Frank Oquendo" wrote in message
news:EE6433BABDE26E9CDDD161DABBB69C8F@in.WebX.maYIadrTaRb...
> Kent Keller wrote:
> > I guess I am not following. In my mind the Assembly Panel is a
> > toolbar..... i.e. go to customize, Toolbars, select Assembly Panel
> > and "Show"
>
> While you can add your own panels to a given environment, MDB is
wanting
> to add a buton to an existing panel (i.e. "Assembly Panel", "Tube &
> Pipe"). I do not think this is possible but would love to be proven
> wrong.
>
> --
> There are 10 kinds of people. Those who understand binary and those
who
> don't.
>
> http://code.acadx.com
> (Pull the pin to reply)
>
>
Message 13 of 17
Anonymous
in reply to: Anonymous

Neil Munro wrote:

> Hope this helps some,

Now *that's* cool!



--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
Message 14 of 17
Anonymous
in reply to: Anonymous

Apologies Kent, I skipped over the earlier posts and didn't see your code.

Neil

"Kent Keller" wrote in message
news:CB32E658288A3B4F085E9A2D1C94DFE3@in.WebX.maYIadrTaRb...
> That is what the Code that I posted and Neil posted now does.
>
> Here is my assembly panel bar, the last 5 icons on the right were added
> by Addins using the same basic code as what I posted.
>
>
> --
> Kent Keller
> http://www.MyMcad.com/KWiK/Mcad.htm
>
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
>
> "Frank Oquendo" wrote in message
> news:EE6433BABDE26E9CDDD161DABBB69C8F@in.WebX.maYIadrTaRb...
> > Kent Keller wrote:
> > > I guess I am not following. In my mind the Assembly Panel is a
> > > toolbar..... i.e. go to customize, Toolbars, select Assembly Panel
> > > and "Show"
> >
> > While you can add your own panels to a given environment, MDB is
> wanting
> > to add a buton to an existing panel (i.e. "Assembly Panel", "Tube &
> > Pipe"). I do not think this is possible but would love to be proven
> > wrong.
> >
> > --
> > There are 10 kinds of people. Those who understand binary and those
> who
> > don't.
> >
> > http://code.acadx.com
> > (Pull the pin to reply)
> >
> >
>
>


----------------------------------------------------------------------------
----
Message 15 of 17
Anonymous
in reply to: Anonymous

No problem, I probably originally stole it from either you or Charles. 8^)

Maybe we will just remove 1 from my tab that I owe you. 8^))

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"Neil Munro" wrote in message
news:EF120EB09A1D0A00C2992B796EFDC99F@in.WebX.maYIadrTaRb...
> Apologies Kent, I skipped over the earlier posts and didn't see your code.
>
> Neil
Message 16 of 17
Anonymous
in reply to: Anonymous

Hello,
I have just replied to Frank's Environmentr IDs post on the 23/10/03
complete with a list of all the command bars in the command bar base
collection... if anyone needs it, I'll dig out the code for iterating over
the command bar base collection if anyone needs it.

Scott
Message 17 of 17
Anonymous
in reply to: Anonymous

I would be interested but even more so in how to build a flyout or
popup. I have a series of commands I would like to have work similar
to the workpoint command bar or the 2D Constraints command bar where
there is one icon, you pick it and a series of others pops up.

Scott Stubbington wrote:

>Hello,
>I have just replied to Frank's Environmentr IDs post on the 23/10/03
>complete with a list of all the command bars in the command bar base
>collection... if anyone needs it, I'll dig out the code for iterating over
>the command bar base collection if anyone needs it.
>
>Scott
>
>
>
>

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums