PDA

View Full Version : Pull-Down Menus & Customiztion



DirtMotoSport125
2005-04-08, 06:23 AM
Using AutoCAD 2005, I use the OPEN command followed by a file location. For example D:/acadlib/plan/1-1.dwg. All 2005 reads is the OPEN command, even if i have FILEDIA off it just won't transfer that file location. I have tried semicolens, dashes, etc. and my customization guide don't have and info on using the OPEN command or the INSERT command. Which i am also having problems using my pull-down menus. Any Suggestions?

Mike.Perry
2005-04-08, 09:46 AM
Hi

For the drawing Open part take a look at the following (comes via and old LISP Guild post from Robert Bell) -

-----Original Message-----
From: owner-guild-lisp@augi.com [mailto:owner-guild-lisp@augi.com] On Behalf Of R. Robert Bell
Sent: 02 July 2002 13:31
To: 'AUGI-LISP'
Subject: Re: [LISP] Open drawing through LISP

Frank Whaley from Autodesk wrote this function to handle the differences between MDI and SDI drawing opens.


(defun CmdOpenDwg (DwgN)
(cond
((= 0 (getvar "SDI"))
(vla-Activate
(vla-Open (vla-Get-Documents (vlax-Get-Acad-Object)) DwgN)
)
)
((vla-SendCommand
(vla-Get-ActiveDocument (vlax-Get-Acad-Object))
(strcat "(command \"_.Open\")\n" DwgN "\n")
)
)
)
)
R. Robert Bell, MCSE
AUGI Guild Moderator
www.AcadX.com

************

Make sure the above is loaded, then from your menu file you can make calls like the following -

^C^C^C^C(CmdOpenDwg "DriveLetterHere:/DirectoryPathHere/DrawingNameHere.dwg");

************

For the Insert part....

^C^C^C^C_.-Insert;"DriveLetterHere:/DirectoryPathHere/DrawingNameHere.dwg";Now fill in the remaining Insert prompts as required.

Have a good one, Mike

DirtMotoSport125
2005-04-10, 04:03 AM
Thanks Mike, One problem came up when i got it in and started. It says "error: no function definition: VLAX-GET-ACAD-OBJECT" what do i need to do to for that I am not very good with lisp and all. Thanks again for the help.

Joe

Mike.Perry
2005-04-10, 10:35 AM
Hi

Try adding (vl-load-com) at the beginning ie.


(vl-load-com)
(defun CmdOpenDwg (DwgN)
etc....
Have a good one, Mike

DirtMotoSport125
2005-04-11, 03:55 PM
Thanks again Mike it worked great now i just have 600 command line to change in my pull-down menu file. But Thanks for the help.

Joe

Tom Beauford
2005-04-11, 05:13 PM
Another option would be to replace "open" with "fileopen" if you don't use SDI mode.

I use this menu item from AfraLISP via MikePerry (thanks again!) to open the drawing I use to print binders:
ID_OpenBinder [Open Binder.dwg]^C^C^P(command "vbastmt" (strcat "AcadApplication.Documents.Open" (chr 34) "C:/Acad/Blocks/Leon_County_Plans_Binder.dwg" (chr 34)))

Using AutoCAD 2005, I use the OPEN command followed by a file location. For example D:/acadlib/plan/1-1.dwg. All 2005 reads is the OPEN command, even if i have FILEDIA off it just won't transfer that file location. I have tried semicolens, dashes, etc. and my customization guide don't have and info on using the OPEN command or the INSERT command. Which i am also having problems using my pull-down menus. Any Suggestions?Good luck,