PDA

View Full Version : Trouble with SSADD


rprovencio
2008-12-15, 07:22 PM
I seem to be having trouble adding mySSAdd to myObjs. Is there something wrong with what I'm doing here???



(setq myP1 (getpoint "\nPick first corner:"))
(setq myP2 (getcorner myP1 "\nPick opposite corner:"))
(command "._rectang" myP1 myP2)
(setq myObjs (ssget "_L"))
(princ "\nSelect island:")
(setq mySSAdd (ssget "_:S"))
(ssadd mySSAdd myObjs)
(command "-hatch" "p" "ANSI31" myHatchScale 0 "s" myObjs "" "")
(setq myPrev myMethod)


Thanks in advance.

Robert

fixo
2008-12-15, 07:50 PM
Try this one instead


(defun C:SSD(/ Myhatchscale Myobjs Myp1 Myp2 Myssadd)
(setq myHatchScale 20.0);<--dummy value
(setq myP1 (getpoint "\nPick first corner:"))
(setq myP2 (getcorner myP1 "\nPick opposite corner:"))
(command "._rectang" myP1 myP2)
(setq myObjs (ssget "_L"))
(princ "\nSelect island:")
(setq mySSAdd (ssget "_:S"))
(ssadd (ssname mySSAdd 0) myObjs)
(command "-hatch" "p" "ANSI31" myHatchScale 0 "s" myObjs "" "")
;;; (setq myPrev myMethod);<-- unused in this context
(princ)
)


~'J'~

rprovencio
2008-12-15, 08:03 PM
Thanks to both.

I used Fixo's fix.....o and it worked great. I thought maybe I needed an entity name, I just wasn't sure how to get it. The help file for SSADD was a little lacking.

fixo
2008-12-15, 09:28 PM
Just a hint:
always look at the Help file
Cheers :)

~'J'~