I was on an older cad and am now moving to 2014.. my previous cad was heavily customized the old school way, I have decided to learn the CUI (and dynamic blocks)
Ok, My old cad has blocks on a drop down menu.. click BATH menu than WC icon, a macro sets the correct layer than inserts the WC.. took time to setup but pretty simple and straight forward (see attached for menu syntax). I also made a toolbar BATH and on that toolbar I made a WC icon.. that’s what I use the most
couple of questions
1) do I have to make a new command in CUI for each block to do the same thing?
2) I looked into the design center, but seems like its too many steps (correct me if im wrong please).. but it seems a toolbar with an icon on it, clicking the icon and a macro sets layer and insers block is still pretty quick..??
3) if a toolbar with an icon is still a fast and less step method, can I open the block and somehow make an icon of it? if so where do I put it?
Like I said im old school but recognize its time to play catch up and learn the new methods.
I appreciate the responses!
You'd probably be better creating a tool palette. It's similar to the Design center only it stores additional information (laters, colors, etc) and references the block definition from a "Source DWG". I've attached a screen shot of what I made as well as a screen shot of the properties for one of the blocks. I created a file with all my blocks in it to pull the definitions from. All you have to do is
1. create a block in the drawing
2. save the drawing
3. then drag the block into the tool palette
The block images can be updated by right clicking on them and selecting "update tool image". You can also open the block for edit in the source drawing block editor, as well as update the block definition in the current file. Hope this helps some, because there are more helpful tools available through the tool palette.
In general, every single tool you want in your user interface (UI) will require a separate command definition in the CUIx. This definition acts like an XREF drawing - one definition referenced in many places (Ribbon, toolbar, menu) allows changes (e.g. command macro) to be made in one place.
More specifically, your previous arrangement (one command tool per block) may not work as well with the new UI systems. The user is presented with a huge number of items, or has to dig down several levels. That can be OK for very common blocks, but its easy to end up with toolbars and buttons cluttering the screen when they rarely get used. Folding ribbon panels and drop-downs can eliminate some of that. But it may be better to consolidate some of the lesser-used items into custom insert routines which, when clicked, provide the user with a selection of items.
Tool palettes can also be useful, but managing palette groups etc. from a central location can be a little frustrating.
Creating icons is a real PITA for those who aren't graphic artists by nature (ie. ME). Consolidating blocks into a single command will reduce the number of icons you need to create.
Totally a reasonable approach, the one dgorsman suggests.
There are of course alternatives.
My method is one driven by CUI and lisp+dcl combos, and one toolbar for very useful 7 tools.
Yes the buttons/icons were a PITA...
Lone toolbar, created some icons borrowed others from autocad library 🙂
Example of how a dropdown utilitizing DCL appears
Typical drop-down menu called DCL driven example, each of these items when clicked on will insert the fitting and if onto blank space will pause for rotation, always keeping a 1 and 1 scale, but if onto a line the program will insert, then trim the underlying line out be it a lwpolyline or otherwise. The images are slides made with mslide.
Only dropdown functionality. Dual method for selection, users felt this was better than only the dialogs for this catagorey. These will all insert the same as the DCL driven items, i.e. they will trim if the insertion point is on a line the lengths i have designated in the code.
Credits and kudos to many including lee mac and kentcooper for assisting in creating this first real program for me
Looks good Brandon - well done!
Couldn't have done it without the continued assistance of the two fellows posting above.
Thanks again you guys, I can't express how great of a feeling it is to bring something more to the table.
And honestly I did not post that to miff the OP, the source code is available upon request. (pm preferably)
Obviously OP would need to re-code everything to their fittings (block name and trim distances), and then take mslides of their entire library.
And those are just the first steps....but, it's a workable option and the leads that have been in the business 25+ years having to manually do *everything* such as Set layer--->Insert-->Block-->Browse to block-->setup insert dialog for block-->place block onto a line---> trim line, whereas now you can imagine two clicks being alot quicker, more effecient, the leads are happy, and there are side benefits such as continued use of this program ridding our new multiple hundred p&id job of the little variances that show when different persons draft similar documents, also the human error that occurs due to layer standards and snap settings- all taken care of and requires the user to simply select from the drop down which menu to load, and then select their fitting and it's insertionpoint.
Again thanks to so many gurus in the completion of this program, i had no idea about a conditional when I started this program. In fact, the (cond) statement still running the routine is the exact same that was laid out by kent cooper nearly 6 months ago for me! Hah, how the time has passed.
Henrique- thanks for helping with the insertionpoint code, that was far too advanced for me then and it's only now that I finally am understanding what you've coded. As such, i'll disect it, right here and now. Don't you remember this beauty?
(if (setq insertpt1 (getpoint "\nPick Insertion Point: ")) ;set variable insertpt1 to user get point (progn ;if point selected do the following (if (and (setq ntsel (nentselp insertpt1)) ;if+and assign variable ntsel to the values returned by nentselp, ;nil if in space, returns name/insertpt if on a line (= (length ntsel) 2) ;if on a line and the length of items returned is 2 (setq name (car ntsel)) ;set a var to the first item in the previous list, entname (wcmatch (cdr (assoc 0 (entget name))) "LINE,LWPOLYLINE") ;wcmatch the entity type to line/lwpolyline );; and (setq objx 1) ;if both the conditions are true raise the objx flag );; if
That's definitely one of the more complicated sections of code and was brought about due to considering user input that did not follow the prompts that were given at that time. It was tough to determine where the user would place the fitting if it was either in space or on a line, and as thus henrique you and I emailed back and forth for a day to arrive at this solution. Granted, you were doing most of the coding, I was testing!
Fun times regardless and it did not go to waste!
Writing, testing, correcting, testing, rewriting, testing, correcting, testing...
It's the programmer life...
Henrique
I appreciate all the responses!
for tool palettes, i currently have a block directory.. do i open each drawing and add each one to the tool palette? and when i want to modify the block do i open that block dwg in my block directory and modify and it updates the tool palette? also, if i am in a drawing and make a new block and add it to the tool palette does it ask me where to save the block?
on the CUI, i added my .MNS file to cui and it actually added the menus and toolbars, of course the icons where clouded out, i assume i have to copy the icons i made to an icon directory in the file path, but the commands were all there and they worked, blocks worked also.. what are the "Cons" of doing it this way in the new cad world?
im going to play around with it today and may be able to answer my own questions.. but its good to see how others look at it, i want to see the advantage of tool palettes over one click blocks on a toolbar..
thanks again!
@Tony wrote:for tool palettes, i currently have a block directory.. do i open each drawing and add each one to the tool palette?
Personally, I find it easier to drag blocks from the Design Center when populating tool palettes.
@Tony wrote:
i have a block library/directory of blocks, when i open the drawing (block) its not a block, its separate entities (becomes block when i insert).. do i have to open each drawing, make it a block (assume make it same name as the drawing) than drag the block to a new tool pallete that i make?.. do that for each block?
Oh definitely not! - That would be an immense amount of work!
No, simply locate the drawing in Design Center and drag the drawing file onto a Tool Palette - you can even drag a drawing file directly from Windows Explorer if this is easier.
Lee