Jump to content

clint0577
 Share

Recommended Posts

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

Link to comment
Share on other sites

(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)
)

Link to comment
Share on other sites

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

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

 Share

×
×
  • Create New...