Jump to content

Named UCS and PLAN all in one LISP not working


skipsophrenic

Recommended Posts

Hi all,

 

Am working on a bit of code to help out my workload,

alot of times i'm working at wierd angles on BIG plans, so

i do named ucs's to make life easier.

 

Here's the problem, I've written the code posted below, but it doesn't

seem to work - can someone tell me where i've gon wrong?

 

;*******************************************************************

;*******************************************************************

;**                                                               **

;**                  THIS ROUTINE IS FOR RESTORING                **

;**                  A NAMED UCS AND RUNNING THE                  **

;**                  PLAN COMMAND AT THE SAME TIME                **

;**                                                               **

;**                                                               **

;**                  (C) PETER SMITH 03-02-2009                   **

;**                  PROVIDED FOR USE BY ALL PLEASE               **

;**                  INCLUDE THIS HEADER WHEN COPYING             **

;**                                                               **

;** CONTACT TO REPORT PROBLEMS: skipsophrenic@hotmail.com         **

;**                                                               **

;*******************************************************************

;*******************************************************************



defun c:ucsplan () ;defined function



           (command "ucs" "na" "re") ;runs the ucs restore option



                       (getstring "\nName of ucs:") ;asks for the name of the ucs wanted



           (command "Plan" "C") runs the plan command and set's it to current ucs



)



(princ)

Link to comment
Share on other sites

  • Replies 51
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    21

  • skipsophrenic

    17

  • uddfl

    4

  • GE13579

    3

Not sure why the "na", but maybe:

 

(defun c:ucsplan (/ uNm)
 (if (and (setq uNm (getstring t "\nSpecify Name of UCS: "))
      (tblsearch "UCS" uNm))
   (progn
     (command "_ucs" "Re" uNm)
     (command "_plan" "c"))
   (princ "\nUCS Name not Found. "))
 (princ))

Link to comment
Share on other sites

Tested and keep getting the following:

 

Command: _appload ucsplan.lsp successfully loaded.

Command: ucsplan

Unknown command "UCSPLAN". Press F1 for help.

Link to comment
Share on other sites

Lee,

Yes prompts are different in 2008:

 

Command: ucs

Current ucs name: xxx

Specify origin of UCS or [Face/NAmed/OBject/Previous/View/World/X/Y/Z/ZAxis]

: na

Enter an option [Restore/Save/Delete/?]: r

Enter name of UCS to restore or [?]:

Link to comment
Share on other sites

Lee,

Yes prompts are different in 2008:

 

Command: ucs

Current ucs name: xxx

Specify origin of UCS or [Face/NAmed/OBject/Previous/View/World/X/Y/Z/ZAxis]

: na

Enter an option [Restore/Save/Delete/?]: r

Enter name of UCS to restore or [?]:

 

Thanks Carl:

 

(defun c:ucsplan (/ uNm)
 (if (and (setq uNm (getstring t "\nSpecify Name of UCS: "))
      (tblsearch "UCS" uNm))
   (progn
     (command "_ucs" "NA" "R" uNm)
     (command "_plan" "c"))
   (princ "\nUCS Name not Found. "))
(princ))

Link to comment
Share on other sites

Tested and keep getting the following:

 

Command: _appload ucsplan.lsp successfully loaded.

Command: ucsplan

Unknown command "UCSPLAN". Press F1 for help.

 

Are you testing yours or mine?

 

Because obviously yours is missing quite a few brackets...

Link to comment
Share on other sites

Nice spot Seneb,

 

Also, you are missing an open bracket for the defun, you have (princ) outside of the function, and you haven't set your string retrieval to any variable.

 

Just a few pointers. :thumbsup:

Link to comment
Share on other sites

:D Your header has more lines than your routine. Sorry, I had to say it.

 

:lol: I noticed the same myself, but that's my standard header now. LOL

 

------------------------------------------------------------------

 

LEE,

 

Sorry when i copied your corrections I missed the last closing

parenthesis, rechecked and job done.

 

Thanks :thumbsup:

Link to comment
Share on other sites

Thanks, I will need the luck - am tryin to figure out how to ask operator to choose which layout to go to, and then have it draw a viewport scaled to fit, with the selected ucs as the plan - fun no? all as part of same routine

Link to comment
Share on other sites

how to ask operator to choose which layout to go to,

 

:reallymad: :reallymad: :reallymad: help pls, i've gone through ev'ry website I know and

turned up nothing - except colourful definitions of the word LISP - all

I'm after is the choos layout bit, as mentioned before - only reason I

haven't asked before is I'm a great beleiver in try and figre it out for

yourself first, then it sticks in your head longer

 

Hence why i angry with myself!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...