Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Computer Aided Design - CAD > Autocad > Re: ETYPE or SO...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 5 Topic 3384 of 3561
Post > Topic >>

Re: ETYPE or SORT LISP question

by vmuntean@[EMAIL PROTECTED] Mar 18, 2008 at 11:02 AM

On Mar 16, 12:57=A0pm, Eduardo Mu=F1oz <emu...@[EMAIL PROTECTED]
> wrote:
> * vmunt...@[EMAIL PROTECTED]
> | Or perhaps I may be able to do this another way. Depending on what
> | entities are selected, one of the two command lines that I need to run
> | will return an "Unknown command" message. If I could write an if
> | statement that will say
> |
> | if "unknown command", then move to the next command line.
> |
> | I am not sure if this is possible or what the sytax may be, but I
> | think it will work if it can be done.
> |
> | Thank you,
> | Vlad
> |
> | On Mar 14, 12:25=A0pm, vmunt...@[EMAIL PROTECTED]
 wrote:
> | > Hello,
> | >
> | > I just run into a problem with one of my lisp functions. Depending
on
> | > the type of entity selected (line, polyline etc), I need to run a
> | > different command.
> | >
> | > I added ETYPE in the (defun list and then I tried to write an if
> | > statement that does the following:
> | >
> | > if the user selected just polylines then a command should be run
> | >
> | > if the user selected polylines AND anything else (this should
include
> | > the scenario where the user selects lines/arcs/..... but NO
polylines)=

> | > another command should be run.
> | >
> | > (if (=3Detype "polyline") (progn
> | > (command "pedit"...)
> | > ))
>
> The code as shown will not work because "=3Detype" is not an
> autolisp function. You should write (if (=3D etype "polyline") ....
> Notice that there is a space betwen the equal sign and the
> symbol etype.
>
> --
> Eduardo Mu=F1oz =A0 =A0 =A0 =A0 =A0| (prog () 10 (print "Hello
world!")htt=
p://www.boundp.net/| =A0 =A0 =A0 =A0 =A020 (go 10))

Thank you, that seems to have worked since I no longer receive the
etype error. Here is what I have now:

	(setq etype (cdr (assoc 0 ssl)))
	(if (=3D etype "polyline") (progn
		(command "" "pedit" "m" SS1 "" "c" "")))
		;(setq etype (cdr (assoc 0 ss1)))
	(if (member etype
			'("3DFACE" "ARC" "ATTDEF" "CIRCLE" "DIMENSION" "ELLIPSE" "HATCH"
			  "INSERT" "LINE" "MTEXT" "POINT" "SOLID" "TEXT") ) (progn
		(command " " "pedit" "m" ss1 "" "" "j" "" "c" "")))

What I am trying to do is when the user has a single, or multiple
polylines selected, it runs :
(command "" "pedit" "m" SS1 "" "c" "")

When the user has anyting else selected (polylines and lines, just
lines, arcs etc) it should run:
(command " " "pedit" "m" ss1 "" "" "j" "" "c" "")

Thank you in advance for any help.
Vlad
 




 5 Posts in Topic:
ETYPE or SORT LISP question
vmuntean@[EMAIL PROTECTED  2008-03-14 11:25:04 
Re: ETYPE or SORT LISP question
vmuntean@[EMAIL PROTECTED  2008-03-14 12:36:25 
Re: ETYPE or SORT LISP question
=?iso-8859-1?q?Eduardo_Mu  2008-03-16 19:57:33 
Re: ETYPE or SORT LISP question
vmuntean@[EMAIL PROTECTED  2008-03-18 11:02:12 
Re: ETYPE or SORT LISP question
vmuntean@[EMAIL PROTECTED  2008-03-19 07:35:31 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Dec 4 1:45:12 CST 2008.