Jump to content

missing a parenthesis i think


chelsea1307

Recommended Posts

I finally found which lisp is causing me problems on my startup suite. Can anyone who knows something about lisp tell me why when this lisp loads it asks for me to select object to scale and stops the rest of the lsps in the startup suite from loading. any help would be great

;; This lisp breaks a two lines which cross each other
(defun c:sc ()
(setq pick (entsel "\nPick:")) (terpri)
(setq pnt (getpoint "\nPick point:" )) (terpri)
(setq scl (getstring "0.5"))
(command "scale" pick pnt scl ) 
) 
(defun c:half ()
(prompt
  "\nPick entities you want to scale: ")
  (setq ss (ssget))
(setq pt (getpoint "\n Pick scale point: "))
(command "scale" ss "" pt 0.5)
)
(defun c:twice ()
(prompt
  "\nPick entities you want to scale: ")
  (setq ss (ssget))
(setq pt (getpoint "\n Pick scale point: "))
(command "scale" ss "" pt 2)
)
(defun c:1QUARTER ()
(prompt
  "\nPick entities you want to scale: ")
  (setq ss (ssget))
(setq pt (getpoint "\n Pick scale point: "))
(command "scale" ss "" pt 0.25)
)
(defun c:three4 ()
(prompt
  "\nPick entities you want to scale: ")
  (setq ss (ssget))
(setq pt (getpoint "\n Pick scale point: "))
(command "scale" ss "" pt 0.75)
)
defun c:alberto ()
(prompt
  "\nPick entities you want to scale: ")
  (setq ss (ssget))
(setq pt (getpoint "\n Pick scale point: "))
(command "scale" ss "" pt 1.5)
)
This one aaa lets you scale reference
(defun c:aaa ()
(command "OSNAP" "ins")
(SETQ object (entsel "\n pick object"))
(SETQ INS (GETPOINT "\NPICK POINT"))
(command "scale" object "" INS "R" "6-1/64" "4.5")
(command "osmode" "0")
)
(defun c:vsc ()
(prompt
  "\nPick entities you want to scale: ")
  (setq ss (ssget))
(setq pt (getpoint "\n Pick scale point: "))
(command "scale" ss "" pt tom)
)
(defun c:t0 ()
(command "style" "" "" 0 "" "" "" "" ""))
)

Link to comment
Share on other sites

try this it has a few problems

 

 
;; This lisp breaks a two lines which cross each other
(defun c:sc ()
(setq pick (entsel "\nPick:")) (terpri)
(setq pnt (getpoint "\nPick point:" )) (terpri)
(setq scl (getstring "0.5"))
(command "scale" pick pnt scl ) 
) 
(defun c:half ()
(prompt
  "\nPick entities you want to scale: ")
  (setq ss (ssget))
(setq pt (getpoint "\n Pick scale point: "))
(command "scale" ss "" pt 0.5)
)
(defun c:twice ()
(prompt
  "\nPick entities you want to scale: ")
  (setq ss (ssget))
(setq pt (getpoint "\n Pick scale point: "))
(command "scale" ss "" pt 2)
)
(defun c:1QUARTER ()
(prompt
  "\nPick entities you want to scale: ")
  (setq ss (ssget))
(setq pt (getpoint "\n Pick scale point: "))
(command "scale" ss "" pt 0.25)
)
(defun c:three4 ()
(prompt
  "\nPick entities you want to scale: ")
  (setq ss (ssget))
(setq pt (getpoint "\n Pick scale point: "))
(command "scale" ss "" pt 0.75)
)
(defun c:alberto ()
(prompt
  "\nPick entities you want to scale: ")
  (setq ss (ssget))
(setq pt (getpoint "\n Pick scale point: "))
(command "scale" ss "" pt 1.5)
)
;;This one aaa lets you scale reference
(defun c:aaa ()
(command "OSNAP" "ins")
(SETQ object (entsel "\n pick object"))
(SETQ INS (GETPOINT "\NPICK POINT"))
(command "scale" object "" INS "R" "6-1/64" "4.5")
(command "osmode" "0")
)
(defun c:vsc ()
(prompt
  "\nPick entities you want to scale: ")
  (setq ss (ssget))
(setq pt (getpoint "\n Pick scale point: "))
(command "scale" ss "" pt tom)
)
(defun c:t0 ()
(command "style" "" "" 0 "" "" "" "" ""))

Link to comment
Share on other sites

After quick glance - just tidied em up a bit:

 

(defun c:sc  (/ pick pnt scl)
 (setq    pick (entsel "\nPick:")
   pnt  (getpoint "\nPick point:")
   scl  (getstring "0.5"))
 (command "scale" pick pnt scl)
 (princ))

(defun c:half  (/ ss pt)
 (prompt "\nPick entities you want to scale: ")
 (setq    ss (ssget)
   pt (getpoint "\n Pick scale point: "))
 (command "scale" ss "" pt 0.5)
 (princ))

(defun c:twice    (/ ss pt)
 (prompt "\nPick entities you want to scale: ")
 (setq    ss (ssget)
   pt (getpoint "\n Pick scale point: "))
 (command "scale" ss "" pt 2)
 (princ))

(defun c:1QUARTER  (/ ss pt)
 (prompt
   "\nPick entities you want to scale: ")
 (setq    ss (ssget)
   pt (getpoint "\n Pick scale point: "))
 (command "scale" ss "" pt 0.25)
 (princ))

(defun c:three4     (/ ss pt)
 (prompt "\nPick entities you want to scale: ")
 (setq    ss (ssget)
   pt (getpoint "\n Pick scale point: "))
 (command "scale" ss "" pt 0.75)
 (princ))

(defun c:alberto  (/ ss pt)
 (prompt "\nPick entities you want to scale: ")
 (setq    ss (ssget)
   pt (getpoint "\n Pick scale point: "))
 (command "scale" ss "" pt 1.5)
 (princ))

(defun c:aaa  (/ object ins)
 (command "OSNAP" "ins")
 (SETQ    object (entsel "\n pick object")
   INS    (GETPOINT "\NPICK POINT"))
 (command "scale" object "" INS "R" "6-1/64" "4.5")
 (command "osmode" "0")
 (princ))

(defun c:vsc  (/ ss pt)
 (prompt "\nPick entities you want to scale: ")
 (setq    ss (ssget)
   pt (getpoint "\n Pick scale point: "))
 (command "scale" ss "" pt tom)
 (princ))

(defun c:t0  ()
 (command "style" "" "" 0 "" "" "" "" "")
 (princ))

 

[a few could be written better imo] :P

Link to comment
Share on other sites

i know... i didnt write any of these, i dont even use these... my office is afraid of change, even though i dont think anyone uses these anymore if i get rid of a file they freak, so i figured i would try to get it so it works without causing problems...

Link to comment
Share on other sites

i know... i didnt write any of these, i dont even use these... my office is afraid of change, even though i dont think anyone uses these anymore if i get rid of a file they freak, so i figured i would try to get it so it works without causing problems...

 

I know exactly what you mean - the office I worked at was the same... only difference was that only one of them out of abour 10 had even heard of macros, DIESEL or LISP. :(

Link to comment
Share on other sites

I actually have it the other way, my company is somewhat nudging me to learn C++ so I can maintain our scripts (for add-on hasbCAD) in the event my colleague (who writes said scripts) should succumb to the "hit by a bus" scenario. Unfortunately, the only actual coding I've ever done was making my Tandy beep out the Für Elise in QBASIC...

Link to comment
Share on other sites

I know exactly what you mean - the office I worked at was the same... only difference was that only one of them out of abour 10 had even heard of macros, DIESEL or LISP.

There's a designer (sic) here with 15+ years experience w/ cadd that refuses to use anything that isn't OOTB; no lisp, no pgp, he has to pick the commands from icons, he won't even use the wheel on his mouse to pan/zoom. It's hard to try to implement anything progressive (e.g. annotative text, dynamic blocks) when people refuse to try and learn. To each their own I guess...

Oops, I didn't mean to hijack the thread.

Link to comment
Share on other sites

There's a designer (sic) here with 15+ years experience w/ cadd that refuses to use anything that isn't OOTB; no lisp, no pgp, he has to pick the commands from icons, he won't even use the wheel on his mouse to pan/zoom. It's hard to try to implement anything progressive (e.g. annotative text, dynamic blocks) when people refuse to try and learn. To each their own I guess...

Oops, I didn't mean to hijack the thread.

 

I think this explains a lot...

 

Yeh, apologies for thread hijack...

Link to comment
Share on other sites

Btw, parenthesis mistakes can be easily spotted using the Visual LISP Editor in ACAD - (type VLIDE at command line).

 

Click "Format" to perform a parenthesis check and line the code up nicely :)

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...