View Full Version : Locating icons for purge,display order etc
hyposmurf
11th May 2003, 12:25 am
From one of my last posts in How do I?I was re-creating menu buttons from icons and menu files Id found from another ex employee.But atfer much head scratching I eventually decided to make my own,couldn't figure out for the life of me which icon matched which menu macro :?In the long run thisll be the best option as Ill know exactly how its done.I can use the standard icons for say modify single attributes etc but when it comes to commands such as purge and display order,where can I locate icons for these buttons?Yes I can make my own but I'd rather stick with the standard CAD symbols such commands.These commands dont appear to be on any existing toolbar?Is there any websites with free icons for CAD menu buttons?
hyposmurf
12th May 2003, 01:41 pm
Does anyone know where the standard AutoCAD 2k bitmap icons are stored ?Also when I've created my own menu buttons where do I store the bitmap icons?Do I store them in the menu file :? ?
fuccaro
12th May 2003, 02:53 pm
Try this link
http://www.contractcaddgroup.com/articles/Customizing_and_Programming_AutoCAD.htm
Is it helping you?
hyposmurf
12th May 2003, 08:46 pm
Apart from the few text overlaps,that's a nifty little site for customisation.I'll have a look and try it,I've been wanting to try VBA out before, but just found long winded books on it, which sent me to sleep.Anyway thanks! :D
fuccaro
13th May 2003, 05:49 am
Sorry, Hiposmurf!
I saved parts from the text by copy-pasting in a word document to make it readable. I used parts from that text to manage my menu files but I never tried the parts about the icons.
Sweet dreams!
hyposmurf
13th May 2003, 01:12 pm
Thanks anyway,it's the best article I've seen on it yet.I'll be a great deal furher ahead once Ive developed all my own customised menus,tailored for more work or a few less clicks however you look at it :D
hyposmurf
20th May 2003, 02:58 pm
I'm getting there at last! :D Managed to make a number of my menu buttons and understand how to associate my icons etc!The next thing Im not to sure of is:
I'm hoping to add a few buttons that will insert a saved block that I have.Ive used the standard insert block command,the macro is ^C^C_insert how do I allow this macro to associate with a particlur block?Im not too hot on autolisp yet.Do I insert the block path in the macro i.e
^C^C_insert;C/AUTOCAD/BLOCKS/_IV;\\;;
This would be for a block called IV stored in my blocks file, within the autocad file on my c drive.Problem is it doesnt work,maybe I need to bury my head in a autolisp book :(
If anyone is able to suss this out for me,most of my blocks are on a CD,will this screw up the toolbar whenever I install or remove that CD?
fuccaro
21st May 2003, 09:52 am
Here is the lisp to insert a block named my_block in the current drawing. Call the function like this (my_ins) with the name included in parentheses.
I wish to know more about menus; I am sure here is a better method to do this.
(defun my_ins()
(setq old (getvar "cmdecho"))
(setvar "cmdecho" 0)
(command "insert" "my_block" (getpoint "position? ") "" "" "")
(setvar "cmdecho" old)
(princ)
)
hyposmurf
21st May 2003, 12:46 pm
Great thanks,had a feeling I'd hear from the lisp wiz :),I'll try that lisp when I get home.Do I insert the name of the block in the place of "my_block" and then insert the route on my cdrive for this block file where it says "position? ". :?
fuccaro
21st May 2003, 01:17 pm
No!
The "Position?" is the message will appear inviting you to pick a point on the screen -the insertion point of your block will be placed here.
Try to put the path to your CD drive in the AutoCAD search path. Or better give the name of your block like:
"d:\\cad\\blocks\\my_block"
The path is placed before the filename. The sintax is DOS like but as separator use "double back slash".
hyposmurf
22nd May 2003, 10:38 pm
I've added this lisp to my menu button,isnerting the file path and the name of the block.It looks like this:
(defun my_ins() ^M; (setq old (getvar "cmdecho")) ^M; (setvar "cmdecho" 0) ^M; (command "insert" "d:\\Blocks-M&E\\IV" (getpoint "position? ") "" "" "") ^M; (setvar "cmdecho" old) ^M; (princ) ^M;
IV is the the block and \\Blocks-M&E is the file path.But it unfortunately doesnt work :( ,maybe Ive missed something out.The last peice of text in my command window is this:
(_> (command "insert" "d:
If I try the next method,then which one of my options will the support path be?The working support file path?The data sources location?Sorry for sounding so :? but this is quite new to me!I'll figure this ****** out eventually,but your help would be greatly appreciated fuccaro :)
fuccaro
23rd May 2003, 06:45 am
In order to debug the lisp lets try it first as it is. Please copy-paste the program lines in your Notepad. Replace the block name in the line
(command "insert" "my_block" (getpoint "position") "" "" "")
with this
(command "insert" "d:\\Blocks-M&E\\IV" (getpoint "position") "" "" "")
and save the file on the desktop as MY_INS.LSP
Open a new drawing and resize the AutoCAD window so you can see on the desktop the file you just create. Drag the file in the drawing area. Type at the command prompt (my_ins) –do not forget the parenthesis. It works? If not, please write me the error message.
Before I sent you this post I walked my self this route. After pasting the program lines in the Notepad I realized that the “ marks (inverted commas, quote marks) are replaced with other characters with a very similar look. I changed them and it worked. Because I do not have any blocks on CD I used one from my hard disc. I do not think that it will be a problem to use the CD.
hyposmurf
26th May 2003, 06:43 pm
Fuccaro it worked!I've added it to my startup through the appload interface,so its loaded whenever I open AutoCAD.I'm also keeping all my customised menu's lisps etc within a dedicated file in my support directory,so they arent mixed in with standard CAD ones. Now I can apply this to loads of blocks that I have,having a toolbar for each area of work. :D.My next move would be to try to understand some lisp,where you put all your // () and ;,also what getvar,cmdecho are used for etc.
Even tough it still works this is what appears when I open CAD for the first time.
Regenerating model.
Initial load, please wait...
This drawing already contains the maximum number of layouts. Operation aborted.
insert Enter block name or [?]: d:\CAD\Blocks-M&E\IV Substituting
[simplex.shx] for [TBA-ISO.shx].
Specify insertion point or [Scale/X/Y/Z/Rotate/PScale/PX/PY/PZ/PRotate]:
position
Can't reenter LISP.
Invalid point.
position
Doesnt bother me too much was just wondering why it happens?
Anyway thanks Fuccaro
fuccaro
27th May 2003, 06:49 am
Hyposmurf
We arrived at the frontier of my knowledge. I wish to have your computer here and to try and to retry things. I suggest you to do not waste your time and try to find help in other place –the menus are not my strong side.
About the Lisp: the line (command “insert” ...) is doing all the job. I decided to set the variable CMDECHO to 0. As effect the routine will run but the executed commands will not appear on the text screen. It is a current practice once the routine is tested we do not need to know details about how it is working. So I saved first the system variable named CMDECHO and I set it to 0. At the end I restored the saved value (using setvar...).
You may try this "short form" to see the difference:
(defun my_ins()
(command "insert" "my_block" (getpoint "position? ") "" "" ""))
Maybe it is missing an error trap; if you type ESC when the routine is working (or if an other error stops the routine) the CMDECHO will keep the 0 value. An error trapping routine can “clean up” the place in this kind of situations. But I decided to make a simple program.
Learning Lisp it is not complicated at all. I am teaching my self, the Net it is full of sources. But I think that it is better to learn Visual Lisp because it is more powerful.
Nice avatar... If I will dream about, probable I will wake screaming. Did you create it your self?
hyposmurf
27th May 2003, 01:00 pm
For some reason everytime I start CAD this block now wants to insert itself.All I need is the macro to do, is insert my block from my CD,Im hoping to do this for many of my blocks.
Right this is what I have in my MY_INS lisp:
(command "insert" "d:\\CAD\\Blocks-M&E\\IV" (getpoint "position") "" "" "")
and this is what is in my menu button macro
^C^C_insert;d:\\CAD\\Blocks-M&E\\IV
The lisp is loaded via appload and is added to my start up suite.Maybe this is the problem,but surely its just loaded & doesnt carry outs its function automatically :? .If I can prevent it form inserting everytime I open a new session of CAD would be a releif and would also like to know how Ill insert the rest of my blocks?Would I need a lisp and macro for each block?seems a bit mad,would slow my CAD up considerably :cry:There must be a simpler method!My avatar is me on a good day when not trying to sort my menu buttons out!Nah its from a website that has a few cool ones,although the look of mine is stating to freek me a bit,weird looking bloke!
hyposmurf
27th May 2003, 01:14 pm
I've just taken the lisp off,so it isnt there at start up and added this to a new menu button:
^C^C(COMMAND "INSERT" "IV" ) and it works!It inputs my block from my CD :D ,can then change this for each new button and insert different buttons.Maybe Im going mad but this must've have worked all along,its only now that I've discovered how simple my answer was :oops: !I added an extra search path to my AutoCAD options to,didnt realise I could thought you just changed the existing. At least it should give some insight to anyone else following a similar path and Im a bit more familiar with lisp now too fuccaro,cheers!
fuccaro
27th May 2003, 01:19 pm
Just a guess (not tryed):
if the lisp is loaded, just call it in the menu. Something like
^C^C(my_ins)
Powered by vBulletin™ Version 4.1.2 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.