warriorwarren
Computer
- Nov 5, 2004
- 4
Hi,
I have created a few pipework components in R14 and now need to add attributes the code is as follows:
(DEFUN ELBOW ()
(setvar "cmdecho" 0) ; stops the code showing on the screen
(setq d$ (getreal "Enter diam:")) ; get size from user
(setq pos$ (getpoint "Probe position to start :"))
(setq r1$ d$) ; r1$-r3$ is the points required to produce a circle
(setq r2$ (* d$ 1.5))
(setq r3$ (* d$ 2))
(setq sp$ (polar pos$ (dtr 180) d$))
(setq ep$ (polar pos$ (dtr 270) d$))
(setq spps$ (polar pos$ (dtr 180) r3$))
(COMMAND "ARC" sp$ "C" POS$ "A" "90")
(COMMAND "LINE" ep$ (POLAR ep$ (DTR 270) D$) "") ; draw line
(COMMAND "ARC" spps$ "C" POS$ "A" "90")
(COMMAND "LINE" sp$ (POLAR sp$ (DTR 180) D$) "")
(COMMAND "ARC" (POLAR sp$ (DTR 180) (/ r2$ 2)) "C" POS$ "A" "90")
(setvar "cmdecho" 1)
(COMMAND "ATTDEF" ............what goes here)
How do I add the attributes in Lisp and then eventually build up a library of more pipeconnectors and when one is created that matches another, it informs the user.
Eventually what Im supposed to have is a library pipe fittings with all attributes including things like price etc....
I have created a few pipework components in R14 and now need to add attributes the code is as follows:
(DEFUN ELBOW ()
(setvar "cmdecho" 0) ; stops the code showing on the screen
(setq d$ (getreal "Enter diam:")) ; get size from user
(setq pos$ (getpoint "Probe position to start :"))
(setq r1$ d$) ; r1$-r3$ is the points required to produce a circle
(setq r2$ (* d$ 1.5))
(setq r3$ (* d$ 2))
(setq sp$ (polar pos$ (dtr 180) d$))
(setq ep$ (polar pos$ (dtr 270) d$))
(setq spps$ (polar pos$ (dtr 180) r3$))
(COMMAND "ARC" sp$ "C" POS$ "A" "90")
(COMMAND "LINE" ep$ (POLAR ep$ (DTR 270) D$) "") ; draw line
(COMMAND "ARC" spps$ "C" POS$ "A" "90")
(COMMAND "LINE" sp$ (POLAR sp$ (DTR 180) D$) "")
(COMMAND "ARC" (POLAR sp$ (DTR 180) (/ r2$ 2)) "C" POS$ "A" "90")
(setvar "cmdecho" 1)
(COMMAND "ATTDEF" ............what goes here)
How do I add the attributes in Lisp and then eventually build up a library of more pipeconnectors and when one is created that matches another, it informs the user.
Eventually what Im supposed to have is a library pipe fittings with all attributes including things like price etc....