Jump to content

Help With Offset Code


WCCSAM

Recommended Posts

I am trying to offset a line and have the layer of the new line to be something different. I found this code below but it defaults to 3/4" offset and I need to be able to user input the offset distance, because it will constantly be different. Can anyone please help .

 

 

;; Offset 0.75 to layer "0"

(defun c:ce (/ ent pt)

(while (and

(setq ent (car (entsel "\nSelect object to offset 3/4 or :")))

(setq pt (getpoint "\nSpecify point on side to offset:"))

)

(command "._offset" 0.75 ent "_non" pt "")

(command "._change" (entlast) "" "_P" "_LA" "0" "")

)

(princ)

)

Link to comment
Share on other sites

look and learn...

(defun c:ce (/ od ent pt)
(setq od (getdist "Enter offset distance: "))
(while (and
(setq ent (car (entsel "\nSelect object to offset or <exit>:")))
(setq pt (getpoint "\nSpecify point on side to offset:"))
)
(command "._offset" od ent "_non" pt "")
(command "._change" (entlast) "" "_P" "_LA" "0" "")
)
(princ)
)

You know the OOTB offset command in 2008 has an option for putting the offset line on a different layer than original.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

×
×
  • Create New...