Jump to content
clint0577

celtype

Recommended Posts

clint0577

All I need to do is change the linetype to "OVERHEAD_ELECTRIC_SERVICE", draw a line or two, then switch back to "BYLAYER" linetype. This code I have written doesn't change the linetype at all and when I take out (setvar "celtype" "bylayer"), it works but then of course I'm out of Bylayer linetype. Somebody please help!!! This is driving me crazy

 

(defun c:OES ()
  (command "layer" "s" "ELECTRIC_LINE" "")
  (SETVAR "CELTYPE" "OVERHEAD_ELECTRIC_SERVICE")
  (command "LINE")
  (setvar "CELTYPE" "bylayer")
  (PRINC)
)

Share this post


Link to post
Share on other sites
Lee Mac
(defun c:oes ( / )
   (command "_.-layer" "_M" "ELECTRIC_LINE" "")
   (if (tblsearch "LTYPE" "OVERHEAD_ELECTRIC_SERVICE")
       (setvar 'celtype "OVERHEAD_ELECTRIC_SERVICE")
   )
   (command "_.line")
   (while (= 1 (logand 1 (getvar 'cmdactive))) (command "\\"))
   (setvar 'celtype "BYLAYER")
   (princ)
)

Share this post


Link to post
Share on other sites
clint0577

Thanks!!!!

Share this post


Link to post
Share on other sites
clint0577

I'm not sure if it matters or not but this is what I came up with

 

   (command "layer" "s" "ELECTRIC_LINE" "")
  (SETVAR "CELTYPE" "OVERHEAD_ELECTRIC_SERVICE")
  (command "LINE" PAUSE)
(WHILE (< 0(GETVAR "CMDACTIVE"))
(COMMAND PAUSE))
  (setvar "CELTYPE" "bylayer")
  (PRINC)
)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×