loading blocks in cuix

loading blocks in cuix

Anonymous
Not applicable
2,258 Views
9 Replies
Message 1 of 10

loading blocks in cuix

Anonymous
Not applicable

Hi,  I have made a palette for my blocks.  

However, I would like to put those blocks in the ribbon tab.

 

How do I load my blocks so it shows in the ribbon with tabs?

Does my blocks have to be in some type of format so I can load in the command CUIXLOAD?

 

Also, how do I get all my blocks in one file so when I load into the cuix it all shows up in the ribbon?

 

Any help would be great.

 

Thanks.

 

0 Likes
Accepted solutions (1)
2,259 Views
9 Replies
Replies (9)
Message 2 of 10

scot-65
Advisor
Advisor
Quick reply:
The CUI stores commands and images (for toolbars and ribbons).
The commands are used to populate the UI areas including menu,
ribbon, toolbars, screen menu, right-click, etc.

If you want to display your library, consider using the tool palette.

For the CUI:
- Define a new command (lower-left pane).
- The macro (lower-right pane) for that command would be something like this: ^C^C-INSERT;MyBlock1;etc.
- If the path to the block is not a "hard-path", add the folder containing your library of blocks to the Support File Search Path (command OPTIONS --> Files tab).
- After command is defined, drag and drop the command from the lower-left pane to the upper-left pane.
- Repeat for each unique block name.
- Study up on how to create ribbon elements. It is stubborn when displaying only text and no associated (32x32 pixels maximum) image.

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 3 of 10

Anonymous
Not applicable

Hi,

Thanks for your reply.

 

I made a tab on the ribbon and made a new command using  ^C^C-INSERT;MyBlock1;etc.

my block is called duplex receptacle so I made it ^C^C-INSERT;DUPLEXRECPTACLE

is the ;etc suppose to be in the macro?  Will the blocks work if it is not a Wblock but just made as a regular block?

 

I also made a drawing for the command image.

The command does not work when I inserted from the small image box I made.

The command is there, and when I insert it says invalid?

 

I'm new to creating commands.  All I know is using the ; means enter.

How do I know and where do I find these meanings when I write a block?

 

Thanks.

 

 

0 Likes
Message 4 of 10

Erense
Collaborator
Collaborator

The key to writing the macro's:

First enter every step into the Commandline.
Every step you have to take there you also must take in the macro. That's the best way to start.

Command line:

-insert

<Enter>

Enter block name or: Drive\folder\drawing.dwg

<Enter>

Specify insertion point or: <Click>

Enter X scale factor <1>: 1 or <Enter

Enter Y scale factor <1>:1 or <Enter>

Specify rotation angle <0>:0 or <Enter>

These steps are all needed for the insertion of 1 block.

Every <Enter> is an ; also needed after any given value.

A macro always end with the ; (single)

So the Macro here will be

^c^c-Insert;Drive/folder/drawing.dwg;0,0;1;1;0;

^c^c is used to make sure no other command is still active.

The insert point has to be given as coordinates.

 

See if you can get started from here.

If my post answers your question, please click the "Accept as Solution" button. This helps everyone find answers more quickly!

Kind regards,

Edwin Rense
Cadac Group AEC BV
Supporting Consultant AEC
Cadac Group .
0 Likes
Message 5 of 10

Anonymous
Not applicable

Hi,

 

Thanks for your reply.

I tried the macro and typed this and still says invalid?

^C^C-Insert;C:/Users/mtan/DUPLEXRECEPTACLE.dwg;0,0;1;1;0;

I also made the slashes the other way. 

 ^C^C-Insert;C:\Users\mtan\DUPLEXRECEPTACLE.dwg;0,0;1;1;0;

When I click on my block image it says in the command Insert block name.. when I type duplexreceptacle it says invalid?  However, when I type speaker.. my speaker block shows up and have to scale and rotate manually.

 

If I type duplex receptacle in one word it says invalid but if I type with a space then it will be and enter command.

 

The block still doesn't insert.  

I also tried with duplex receptacle with no space? my block is with space in the title, should it be written without?

 

I also made a regular block without Wblock and wrote on the macro 

^C^C-Insert;DUPLEXRECEPTACLE;0,0;1;1;0; and it still says invalid.

 

Also, is there a way that on the image of my command I can make it look like the block?  Instead of editing and creating on the editing on the button image?

 

I just want to save my blocks to desktop in a folder called blocks.  The blocks is called speaker and another block called duplex receptacle.

How do I write that macro?

 

Thanks.

0 Likes
Message 6 of 10

pendean
Community Legend
Community Legend
Friend, why are you resisting the use of ToolPalettes for this simply insert-a-block task? It does all you want and more, and its built-in ready to use, make an image that looks like your block, handles all the correct INSERT prompts etc.


If you only want to do it the long and hard way with CUI command and waste time setting it up, explain if your individual blocks are separate DWG files in folders or are they inside container files.

And with CUI, you have to draw an image for each block to place on a button, the drawing tab in CUI is right there, help yourself, it's one step up from etch-a-sketch: this is another total waste of time IMHO for the simple task of creating a drag-and-drop block interface in AutoCAD to use using CUI command.

Message 7 of 10

Anonymous
Not applicable

Hi,

 

I have made palettes, I just like the look of having the ribbons with the small icons.

Yes I have blocks saved in each dwg file and a file with one drawing with the blocks all in one dwg.

 

Is it best to use the block saved in one dwg when writing each marco?

 

I have the images I have made from the palettes, is there any way I can put those PNG image to the command image button?  The command image button to export is .bmp file.

 

Also,  I have made a ribbon with a panel and put all the items I need in the CUI.

What do I need to do if I want this ribbon I just made with commands in it and put onto another computer?

 

Do I saved this panel into a CUIX? if so how to save into a CUIX so when I load the ribbon is there?

 

Thanks.

0 Likes
Message 8 of 10

pendean
Community Legend
Community Legend
Accepted solution
Roll up your sleeves then, you have a lot of work to do...

For each and every folder that all of your individual blocks reside it, add them to the AutoCAD search path in OPTIONS command's FILES tab, top selection. Apply, SAVE, restart AutoCAD for it to take effect.

For each block, in CUI command's Commands-list section, start a new command then fill in all the required information you need.The macro is not rocket science, you just put in the following:
^C^C_INSERT;BLOCKNAME

If you don't want to be bothered with answering the remaining insert-command questions at the command line, add more semi-colons for each defaul answer it requires to insert. Note that each block with attributes prompts that require input will need to be accommodated with a pause in your macro code, which is done with a \ symbol.

Avoid the rookie mistake with macro writing: use a semi-colon for <enter> and never a blank space, they are easier to count.

DO NOT have an blank spaces in your block name, another rookie mistake with macro writing.

For the image for each and every block, you can either use the etch-a-sketch tool at the top right of the CUI section while you are in the command, or you can use Windows Snipping Tool to capture a screenshot of each and every block in a drawing file ans save it to PNG. Use a 3rd party Image Editing tool to resize the PNG image file to exactly 32x32 pixel size. Use the block name for the image name. Drop all images into a folder that needs to be added to the AutoCAD Search Paths (restart AutoCAD after adding it) before you go grab it in CUI command to add for each and every block.

That's it. Its all about trial and error on your end. Start now, you might be done in a week or ten.

Good luck.

0 Likes
Message 9 of 10

Anonymous
Not applicable

Hi,

 

Thanks for your reply, I put search file path and it works!

The blocks I have are all annotative.  However, when I use this in the macro

-INSERT;lei-fa-11;\CHPROP;L;;LA;REC;;  and when I click my command image and insert, it ask for the scale factor X,Y,Z.  My blocks are annotative so I just want to insert it specify the rotation using ortho with my mouse and that's it.  How do I know how many ;;; to put in?

How do I know what each letter means?  From the above macro, what are L, LA, REC means?

is there somewhere in autocadd or online where I can know what these letters are?

 

I got the above macro through another forum.  

 

I also used the simple macro -INSERT;lei-fa-11;

That also ask me for the XYZ and rotation.

 

Also, I have a few blocks without annotative since that needs to be to size.

What macro should that be?

 

Thanks.

 

 

 

 

 

 

 

0 Likes
Message 10 of 10

ktnalive
Enthusiast
Enthusiast

This post is for the 2023 version of AutoCAD not for the 2019 version.

 

Please see this guy's video to show what the folks up above said to do as it is pretty much the same, just visualized.

https://www.youtube.com/watch?v=68bbvQoMu-U

0 Likes