.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to create a toolbar

3 REPLIES 3
Reply
Message 1 of 4
michael_vanhoose
533 Views, 3 Replies

how to create a toolbar

Does anybody have anycode to create a toolbar?  found some samples, but none worked

3 REPLIES 3
Message 2 of 4

I'll provide you with the logic since you already have the sample.

 

  • Create a Customization Section (newCS)
  • Give it a name
  • Create a MacroGroup associated to your newCS MenuGroup
  • Add MenuMacro(s) associated to your MacroGroup. These mene macros don't do anything by themselves, you won't see them anywhere so you have to "add them" to toolbars or other objects.
  • Create a ToolBar associated to your newCS MenuGroup.
  • Add ToolbarButton associated to your ToolBar. These toolbar buttons are the ones that have a 'link' to the menu macros and that's how they create an 'action'. You associate menumacros and toolbarbuttons by the menumacro ID.

If you have any doubts or problems, let me know, I'll be here.

Message 3 of 4

Thanks, got it to work.

 

But, can't seem to update the workspace after.  It say's to use

Dim

flName AsString= cs.CUIFileBaseName

 

Application.DocumentManager.MdiActiveDocument.SendStringToExecute(

"cuiunload " & flName & " ", False, False, False)

Application.DocumentManager.MdiActiveDocument.SendStringToExecute(

"cuiload " & flName & " filedia 1 ", False, False, False)

 

 

Also, what class has the commands with the bitmap images?

 

Message 4 of 4

That's a tricky part >.<
I'll post the C# code for that part.

 

//We save the settings for CMDECHO (command echo) and FILEDIA (file dialog)
object oldCmdEcho = Application.GetSystemVariable("CMDECHO");
object oldFileDia = Application.GetSystemVariable("FILEDIA");
//Set new settings for CMDECHO AND FILEDIA so the partial cuix is seamless Application.SetSystemVariable("CMDECHO", 0); Application.SetSystemVariable("FILEDIA", 0); //At this point I use a bool variable already set lines above to check if the partial cuix was already in the main cuix. newDocument.SendStringToExecute("_.cuiunload " + myCuiName + " ", false, false, false);

//Load the cui newDocument.SendStringToExecute("_.cuiload " + cuiFileToSend + " ", false, false, false); //cuiFileToSend is the full path for the .cuix. If it has spaces it will require double quotes @""C:\My Path is a pretty path\my cui.cuix"" I will always double quote it, you never know.

//Load the old echo and filedia values
newDocument.SendStringToExecute("(setvar \"FILEDIA\" " + oldFileDia.ToString() + ")(princ) ", false, false, false); newDocument.SendStringToExecute("(setvar \"CMDECHO\" " + oldCmdEcho.ToString() + ")(princ) ", false, false, false);

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost