AutoCAD 2007/2008/2009

Reply
Contributor
tsynnott
Posts: 24
Registered: ‎04-05-2010
Message 1 of 13 (653 Views)
Accepted Solution

Running a custom routine from the command line

653 Views, 12 Replies
02-25-2011 07:35 AM

My problem is with calling a custom command from the command line. The command is successfully called from a menu item contained in a partial CUI. The command, as shown in the attachment, is RELIMIT. Since the command is defined as RELIMIT in the Comand Name field I expected this would be the value submitted from the command line. Again, the operation works when selected from the menu in the partial CUI, but when entered from the command line I get the following message: Unknown command "RELIMIT". Is there somewhere else I need to define this command (acad2009.lsp, perhaps)?More precisely, the problem is with calling a custom command from a menu item contained in a partial CUI. The command, as shown, is RELIMIT. Since the command is defined as RELIMIT on the Comand Name line I expected that this would be the value submitted from the command line. The operation works when selected from the menu in the partial CUI, but when entered from the command line I get the following message: Unknown command "RELIMIT".

*Expert Elite*
pendean
Posts: 21,642
Registered: ‎11-06-2003
Message 2 of 13 (646 Views)

Re: Running a custom routine from the command line

02-25-2011 07:50 AM in reply to: tsynnott

RELIMIT is the menu item name and has nothing to do with your loaded routine: your routine is calling and loading a file called DLCRLMIT. Maybe that is what you type instead, or RLIMIT.

 

Otherwise you need to find and open that DLCRLMIT lisp (or user help file that may have come with it) and find out what command you do need to type. The Author of that routine can help.

Dean Saadallah Blog | Facebook | Google+ | Twitter | PINS
Contributor
tsynnott
Posts: 24
Registered: ‎04-05-2010
Message 3 of 13 (643 Views)

Re: Running a custom routine from the command line

02-25-2011 08:15 AM in reply to: pendean

Thanks for the quick response.

First, the person who wrote the command (and designed the menuing system I have just moved from 2002 to 2009) is long gone. Which leads me to note -- in 2002 typing RELIMIIT in the command line does run the macro defined in the MNS file. The following line is taken directly from the 2002 MNS: [RELIMIT - Redefine Drawing Limits/Plot Scales:]^C^C(if (= rlimit nil) (load "DLCRLMIT")) (rlimit).

Second, in 2002 entering 'DLCRLMIT' or 'rlimit' in the command line produces the "Unknown command..." message.

Finally, the way the CUI form is designed, it seems to me the 'Command Name' is meant to map to the Maco value. I can't imagine another reason for a 'Command Name' value since the Display Name value defines what appears on the menu (which works). Can you think of any other file in which RELIMIT gets mapped to its Macro?

*Expert Elite*
pendean
Posts: 21,642
Registered: ‎11-06-2003
Message 4 of 13 (639 Views)

Re: Running a custom routine from the command line

02-25-2011 08:29 AM in reply to: tsynnott

Let's clarify to make sure we understand each other: nothing, NOTHING, tagged or named or renamed in the CUI or R2002's MNU/MNS files back in the day will make any command suddenly available at the command line to be typed.

 

Your external routine must load in AutoCAD and then you can type whatever that routine's creator made available to you to type. Perhaps your R2002 seat had a PGP file edit that redirected the word RELIMIT to whatever this routine calls to launch.

 

Is this routine a open LISP? If yes, post it let someone here look at it more closely and see what the real issue is with it or the CUI.

 

What is RLIMIT variable (it must be nil to run the customization) that your routine is calling?

 

Dean Saadallah Blog | Facebook | Google+ | Twitter | PINS
*Expert Elite*
Patchy
Posts: 6,208
Registered: ‎09-16-2009
Message 5 of 13 (633 Views)

Re: Running a custom routine from the command line

02-25-2011 08:37 AM in reply to: tsynnott

Have you made a path wherever this lisp that you have so 2009 can find it ?

Contributor
tsynnott
Posts: 24
Registered: ‎04-05-2010
Message 6 of 13 (615 Views)

Re: Running a custom routine from the command line

02-25-2011 09:00 AM in reply to: tsynnott

Thanks, this is valuable information (e.g. nothing tagged... etc.) I'm a complete neophyte regarding AutoCAD so I'm unfamiliar with such aspects as PGP files - I'll check a 2002 seat for possible clues.

 

To your question re path: yes, but should I assume that since the menu version of RELIMIT is running properly that the path in options is set correctly?

 

*Expert Elite*
Patchy
Posts: 6,208
Registered: ‎09-16-2009
Message 7 of 13 (611 Views)

Re: Running a custom routine from the command line

02-25-2011 09:11 AM in reply to: tsynnott

You will not find it in 2002 PGP file.

It could be in ACAD.LSP (back then ) a string to load this lisp.

Copy everything related to this customization to 2009 Support Folder. Make ACADDOC.LSP and put the load line of 2002 to it. Reboot.

*Expert Elite*
pendean
Posts: 21,642
Registered: ‎11-06-2003
Message 8 of 13 (588 Views)

Re: Running a custom routine from the command line

02-25-2011 11:35 AM in reply to: Patchy

Based on the OP posts... The fact that the routine runs as a picked menu item but not at the command line is an indication doing all this would not result in a fix: the command is being loaded with the menu item, the problem is no one knows what command it is actually calling, so loading it in ACADDOC.LSP will not be a cure.

 

I suspect it is calling RLIMIT, not E, since the CUI code looks for it before loading and calling it.

Dean Saadallah Blog | Facebook | Google+ | Twitter | PINS
Contributor
tsynnott
Posts: 24
Registered: ‎04-05-2010
Message 9 of 13 (584 Views)

Re: Running a custom routine from the command line

02-25-2011 11:43 AM in reply to: tsynnott

Eureka!

I followed patchy's advice and scoured the 2002 delivery for acaddoc.lsp. No luck. However, I did find a another .lsp file with what appeared to be load strings for a variety of menu commands that I am able to run from the command line in 2002. I copied the file to the Support folder on the 2009 machine, renamed it to ACADDOC.LSP, launched AutoCAD, loaded a file, entered RELIMIT in the command line and watched as the routine ran. Thank you all, and in particular, Patchy.

 

Regards,

Thomas Synnott

*Expert Elite*
Patchy
Posts: 6,208
Registered: ‎09-16-2009
Message 10 of 13 (580 Views)

Re: Running a custom routine from the command line

02-25-2011 11:52 AM in reply to: pendean

These are tough to hunt down and fix unless the PC is in front of us.

I'm hit and miss.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community




Connect with AutoCAD

Twitter

Facebook

Blogs

Pinterest

Youtube