Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Ribbon button call to a particular dll

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
558 Views, 5 Replies

Ribbon button call to a particular dll

Hello ALl,

I want to call/execute a dll/mutiple dlls by clicking a custom ribbon button/buttons in civil3d. Which is the best way?
I read about creating a cuix file. Is that the way? If yes, how do i create a cuix file?

 

Thanks in advance.

5 REPLIES 5
Message 2 of 6
Jeff_M
in reply to: Anonymous

This is for AutoCAD LT but the process is the same.

https://knowledge.autodesk.com/support/autocad-lt/learn-explore/caas/CloudHelp/cloudhelp/2019/ENU/Au...

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 6
Anonymous
in reply to: Jeff_M

Thank you for your reply Jeff. Will look into the link.

But to call another dll from a ribbon button, is cuix the way to go?

Message 4 of 6
norman.yuan
in reply to: Anonymous

What do you mean by "...call/execute dll or dlls..."? From AutoCAD UI, be it command line, or ribbon menu item (button...), user EXECUTE an AutoCAD built-in commands, or a custom commands defined in a plugin *.dll.

 

If by "...call dll..." you mean to load the DLL, then the ribbon button should execute command "NETLOAD", again, not call/execute a DLL.

 

If you do mean to call commands defined by a DLL, then, the most common way is do customize the CUI. That is, execute command "CUI" to modify existing CUIX file or adding new partial CUIX file. You need to learn how to customizing AutoCAD ribbon menu, which is the skill a good AutoCAD user should master, just as what @Jeff_M 's reply refers to. Of course, if you want to execute a commands defined in a DLL, the DLL has to be loaded first. There are different way to load the DLLs (on AutoCAD startup, or not). As I said, you can even load it with a ribbon button (but it is loading DLL, not necessarily "...call/execute dll...", unless the dll is an IExtensionApplication, which would run some code on loading).

 

Norman Yuan

Drive CAD With Code

EESignature

Message 5 of 6
Anonymous
in reply to: norman.yuan

Hello Norman,

 

Thank you for your reply. I have understood what you have said. I will give it a try from my end.

Message 6 of 6
Sea-Haven
in reply to: Anonymous

I would look at a custom.mnu it can be much easier to modify than going through the CUI, you can have POP menu's and toolbars,if you can use Notepad then you can make a mnu.

 

This is an example of a pop menu and toolbar I have taken CIV3D commands that I often use and made a menu, I use this in the drafting and annotation workspace so dont need to change work spaces. I have a toolbar that allows surface setting with no need to go to toolspace to change say contours. It has icons for like 0.1 0.5 1.0 2.5 Off watershed. It supports multiple surfaces asks which surface to set when more than 1. Peivate mail me if want more info don't look here often.

 

***MENUGROUP=ALANSTOOLBAR
***TOOLBARS
**ALANSTOOLS
ID_ALAN_0    [_Toolbar("Alans1", _Right, _Show, 0, 0, 1)]
AECC_ShowTS  [_Button("Show Toolspace", RCDATA_16_IMAGE, RCDATA_16_IMAGE)]^C^C^C^P_ShowTS
ID_Matchprop [_Button("Match Properties", RCDATA_16_MATCH, RCDATA_16_MATCH)]^C^C_matchprop
ID_Erase     [_Button("Erase", RCDATA_16_ERASE, RCDATA_32_ERASE)]^C^C_erase
ID_Copy      [_Button("Copy", RCDATA_16_COPYOB, RCDATA_32_COPYOB)]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_copy,^C^C_copy)
ID_Mirror    [_Button("Mirror", RCDATA_16_MIRROR, RCDATA_32_MIRROR)]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_mirror,^C^C_mirror)
ID_Offset    [_Button("Offset", RCDATA_16_OFFSET, RCDATA_32_OFFSET)]^C^C_offset
ID_Array     [_Button("Array...", RCDATA_16_ARRREC, RCDATA_32_ARRREC)]^C^C_array
ID_Move      [_Button("Move", RCDATA_16_MOVE, RCDATA_32_MOVE)]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_move,^C^C_move)
ID_Rotate    [_Button("Rotate", RCDATA_16_ROTATE, RCDATA_32_ROTATE)]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_rotate,^C^C_rotate)
ID_Scale     [_Button("Scale", RCDATA_16_SCALE, RCDATA_32_SCALE)]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_scale,^C^C_scale)
ID_Stretch   [_Button("Stretch", RCDATA_16_STRETC, RCDATA_32_STRETC)]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_stretch,^C^C_stretch)
ID_Trim      [_Button("Trim", RCDATA_16_TRIM, RCDATA_32_TRIM)]^C^C_trim
ID_Extend    [_Button("Extend", RCDATA_16_EXTEND, RCDATA_32_EXTEND)]^C^C_extend
ID_BreakSele [_Button("Break at Point", RCDATA_16_BREAKATPT, RCDATA_32_BREAKATPT)]^C^C_break \_f \@
ID_Break     [_Button("Break", RCDATA_16_BRE2PT, RCDATA_32_BRE2PT)]^C^C_break
ID_Join      [_Button("Join", RCDATA_16_JOIN, RCDATA_32_JOIN)]^C^C_join
ID_Chamfer   [_Button("Chamfer", RCDATA_16_CHAMFE, RCDATA_32_CHAMFE)]^C^C_chamfer
ID_Fillet    [_Button("Fillet", RCDATA_16_FILLET, RCDATA_32_FILLET)]^C^C_fillet
ID_Explode   [_Button("Explode", RCDATA_16_EXPLODE, RCDATA_32_EXPLODE)]^C^C_explode
ID_LAYFRZ    [_Button("Layer, Layer Freeze", RCDATA_16_FRZLAY, RCDATA_32_FRZLAY)]^C^C_layfrz
ID_LAYOFF    [_Button("Layer Off", RCDATA_16_OFFLAY, RCDATA_32_OFFLAY)]^C^C_layoff
ID_LAYISO    [_Button("Layer Isolate", RCDATA_16_LAYISO,RCDATA_32_LAYISO)]^C^C_layiso
MM_LAYUNISO  [_Button("Layer Unisolate", RCDATA_16_LAYUNISO, RCDATA_32_LAYUNISO)]^C^C_Layuniso
ID_LAYDEL    [_Button("Layer, Layer Delete", RCDATA_16_LAYER_DELETE,RCDATA_32_LAYER_DELETE)]^C^C_laydel
ID_Line      [_Button("Line", RCDATA_16_LINE,RCDATA_32_LINE)]^C^C_line
MM_1608      [_Button("Circle", RCDATA_16_CIRRAD,RCDATA_32_CIRRAD)]^C^C_circle
MM_1607      [_Button("Arc", RCDATA_16_ARC3PT,RCDATA_32_ARC3PT)]^C^C_arc
ID_Pline     [_Button("Polyline", RCDATA_16_PLINE,RCDATA_32_PLINE)]^C^C_pline
ID_Pedit     [_Button("Polyline Edit", RCDATA_16_PEDIT, RCDATA_32_PEDIT)]^C^C_pedit
ID_DrawordeB [_Button("Draw Order, Send to Back", RCDATA_16_SN2BCK,RCDATA_32_SN2BCK)]^C^C^P_ai_draworder _Back ^P
ID_Appload   [_Button("Load Application...", RCDATA_16_LOAD_APPLICATIONS,RCDATA_16_LOAD_APPLICATIONS)]^C^C_appload
ID_PLOTPDF   [_Button("Plot Col", RCDATA_16_PRINT,RCDATA_16_PRINT)]^C^C(load "plota3colrange")
ID_PLOTPDF   [_Button("Plot Pdf", RCDATA_16_PDF_CLIP,RCDATA_16_PDF_CLIP)]^C^C(load "plotA3Pdfrange2")
ID_PLOTPDF   [_Button("Plot B-W", RCDATA_16_PREVIEW_NEW,RCDATA_16_PREVIEW_NEW)]^C^C(load "plotA3black-white")

**ALANSTOOLS2
ID_ALAN_1    [_Toolbar("Alans2", _LEFT, _Show, 50,50, 1)]
CL           [_Button("Draw Cl", COGGCL.BMP, COGGCL.BMP)]^C^C^C-la s Design-Cl  line;
Lip          [_Button("Draw Lip", COGGLIP.BMP, COGGLIP.BMP)]^C^C^C-la s Design-Lip  line;
Bok          [_Button("Draw Bok", COGGBOK.BMP, COGGBOK.BMP)]^C^C^C-la s Design-Bok  line;
Conc         [_Button("Draw Design Line", "S:\AutoDESK\ICONS\COGGCONC.BMP", "S:\AutoDESK\ICONS\COGGCONC.BMP")]^C^C^C-la s Design-General  line;
Drive        [_Button("Draw Driveway", RCDATA_16_THICKEN, RCDATA_32_THICKEN)]^C^C^C-la s Design-Driveway  line;
Draincl      [_Button("Draw Drain Cl", RCDATA_16_LINE, RCDATA_32_LINE)]^C^C^C-la s Design-Drainage-Cl  line;
Draininv     [_Button("Draw Drain Inv", RCDATA_16_OSNPAR, RCDATA_32_OSNPAR)]^C^C^C-la s Design-Drainage-Invert  line;
Drainpit     [_Button("Draw Drain Pit", RCDATA_16_EXTRACT_EDGES, RCDATA_32_EXTRACT_EDGES)]^C^C^C-la s Design-Drainage-Pits  line;
Housedrain   [_Button("Draw House Drain", RCDATA_16_OSNNEA, RCDATA_32_OSNNEA)]^C^C^C-la s Design-Drainage-House-drain  line;
Linemark     [_Button("Draw Linemarking", RCDATA_16_DIMARC, RCDATA_32_DIMARC)]^C^C^C-la s Design-Linemarkings  line;
Hatch        [_Button("Draw Road hatch", RCDATA_16_MYWORKSPACE, RCDATA_32_MYWORKSPACE)]^C^C^C-la s Design-Hatch  hatch;
Pathatch     [_Button("Draw Path hatch", RCDATA_16_WALK-THROUGH_SAVE, RCDATA_32_WALK-THROUGH_SAVE)]^C^C^C-la s Design-Hatch-path  hatch;
Nathatch     [_Button("Draw Nature hatch", RCDATA_16_RECTAN, RCDATA_32_RECTAN)]^C^C^C-la s Design-Hatch-naturestrip  hatch;
Text         [_Button("Draw Text 1", RCDATA_16_MTEXT, RCDATA_32_MTEXT)]^C^C^C-la s Text  text;
Text2        [_Button("Draw Text 2", RCDATA_16_SINGLE_DTEXT, RCDATA_32_SINGLE_DTEXT)]^C^C^C-la s Text  text;
MiddlePt     [_Button("Middle 2 pts","COGGMTP.BMP","COGGMTP.BMP")]MTP;
ZZZ          [_Button("Command","COGGZZZ.BMP","COGGZZZ.BMP")]^c^cZZZ;
Alloff       [_Button("All Off","Alloff.BMP","alloff.BMP")]^c^c^c(setq surface "_COGG All Off")(load "vercheck")(load "listselect")(load "changecontours6")
50mm         [_Button("50mm cont","50mm.bmp","50mm.bmp")]^c^c^c(setq surface "_COGG NS 0.05 Contours")(load "vercheck")(load "listselect")(load "changecontours6")
100mm        [_Button("100mm cont","100mm.BMP","100mm.BMP")]^c^c^c(setq surface "_COGG NS 0.1 Contours")(load "vercheck")(load "listselect")(load "changecontours6")
200mm        [_Button("200mm cont","200mm.BMP","200mm.BMP")]^c^c^c(setq surface "_COGG NS 0.2 Contours")(load "vercheck")(load "listselect")(load "changecontours6")
500mm        [_Button("0.50m cont","500mm.BMP","500mm.BMP")]^c^c^c(setq surface "_COGG NS 0.5m Contours")(load "vercheck")(load "listselect")(load "changecontours6")
1m           [_Button("1m cont","1m.BMP","1m.BMP")]^c^c^c(setq surface "_COGG NS 1m Contours" )(load "vercheck")(load "listselect")(load "changecontours6")
Triangles    [_Button("Triangles","TRI.BMP","TRI.BMP")]^c^c^c(setq surface "_COGG NS Triangles" )(load "vercheck")(load "listselect")(load "changecontours6")
Slope        [_Button("Slope","RCDATA_16_SM_EXTEND","RCDATA_32_SM_EXTEND")]^c^c^c(setq surface "_COGG Slope Arrows & Catchments" )(if (not AH:Vercheck)(load "vercheck"))(if (not AT:ListSelect)(load "listselect"))(if (not AH:Changecont)(load "changecontours6"))
ID_Ddim      [_Button("Dim Style",RCDATA_16_DIMSTY,RCDATA_32_DIMSTY)]^c^c_dimstyle
ID_Dimaligned[_Button("Dim align",RCDATA_16_DIMALI,RCDATA_32_DIMALI)]^c^c_dimaligned
ID_Dimlinear [_Button("Dim Lin",RCDATA_16_DIMLIN,RCDATA_32_DIMLIN)]^C^C_dimlinear
ID_Mleader_Style[_button("MLEADERSTYLE",RCDATA_16_ML_STYLE,RCDATA_32_ML_STYLE)]^c^c_mleaderst
M2P          [_Button("M2P","M2P.BMP","M2P.BMP")](command "M2P")

  

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report