Jump to content

Recommended Posts

Posted

Does anyone have a lisp that will repeat offset for a list of values from a text that will allow the user to select the item to offset?

 

We do a lot of cross sections with map 3d and need someway to indicate the existing road on them. This would help alot.

 

Thanks.

Posted

Theres lots of lisps here about multiple offsets and setting offset values you could do a simple set a default value and press enter to accept. I use this technique where we know we are going to draw a value continuously in a session, a repeat of the lisp does not ask the questions, only draw back is need a 2nd lsp normally type it at command line (setq OFF1 nil) to reforce a user input again.

 

Something else if you have previously drawn offset lines I did a drag over lines and it auto works out the offset values so you dont have to remember them. Very handy for architectural walls of different sizes used in conjunction with a draw wall lisp.

Posted (edited)

Instead of reading the value from a file. You can use XDATA approach

 

(defun c:OXDSample (/ Add_XData Read_XData obj OData ofd)
;;; Xdata Function by  ASMI  ;;;
(defun Add_XData (Ent ; - Entity Ename 
   App ; - Application name
   dList ; - XData list (list(cons group data)...)
        )
(regapp App)
(entmod(append(entget Ent)(list(list -3(append(list App)dList)))))
 )
(defun Read_XData  (
                   Ent  ; - Entity Ename 
                   apName      ; - Application name
                   /
                   xEnt)
     (setq xEnt (entget Ent (list apName))
           xEnt (vl-remove
                      apName
                      (cadar
                            (vl-remove-if
                                  (function
                                        (lambda (a)
                                              (/= -3 (car a))))
                                  xEnt)))
           )                           ; end setq
     )
(while (setq obj (car (entsel "\nSelect object to offset:")))
     (if (setq OData (Read_XData obj "Offset values"))
           OData
           (progn (initget 1)
                 (setq ofd (getdist "\nOffset Distance: "))
                 (Add_XData
                       obj
                       "Offset values"
                       (list (cons 1000 (rtos ofd 2))))
                 (setq OData (Read_XData obj "Offset values")))
           )
     (command "_offset" (distof (cdar odata)) obj pause "")
     )(princ)
          )

 

If the entity selected doesnt have a Xdata value , the program will prompt you for distance. if it does have the data then it will prompt you to pick side to offset and use the data assigned to that entity

 

Try it.

HTH

 

EDIT: and YES the values will still be there when you close the file.

Edited by pBe

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