Jump to content

Recommended Posts

Posted

Hello all,

I was looking for a lisp routine that will perform A DIMCONTINUE for arcs but no success.

If you have something like this could you please share the code ?

Also, it is possible to dimension only portions of an arc using a lisp?

 

Thank you

Posted
Also, it is possible to dimension only portions of an arc using a lisp?

 

No LISP is required for this, simply use the 'Partial' option of the standard DIMARC command:

Command: _dimarc
Select arc or polyline arc segment:
Specify arc length dimension location, or [Mtext/Text/Angle/[color=red]Partial[/color]]:

Posted

Thank you Lee,

I feel so embarrassed I didn't know about this one ( I am using Acad for a long time).

What about creating continuous dimensions for an arc?

It is still possible without LISP?

Posted

I did some research and i found this lisp.

I don't know who wrote this program in order to give him or her credit for.

; DLA.LSP - dimension length of arc
; modified version of DIMARC from (^v^) XANADU, http://www.xanadu.cz
; runs continuously - <Esc> to exit

(defun C:DLA ( / *ERROR* pt1 pt2 cen a1 a2 ad D1 D2 D i r oldOs oldCmde)

(defun *ERROR* (msg)
  (princ " function")
  (setvar "OSMODE" oldOs)
  (setvar "CMDECHO" oldCmde)
  (princ)
)

(setq oldCmde (getvar "CMDECHO"))
(setq oldOs (getvar "OSMODE"))
(setvar "CMDECHO" 0)
(while T
 (princ "\n Pick 2 points on an arc - ")
 (setvar "OSMODE" 33)
   (while (not cen)
      (setq pt1 (getpoint "\n 1st pt: ")
        cen (osnap pt1 "_CEN")
      )
      (if (not cen) (alert "Doesn't lay on an arc, retry")
    (setq pt2 (getpoint pt1 "\n 2nd pt: "))
      )
   ) ; while
 (setvar "OSMODE" 0)
 (setq a1 (angle cen pt1) 
       a2 (angle cen pt2) 
       ad (abs (- a2 a1))
   r (distance pt1 cen)
   D1 (* r ad)
       D2 (* r (- (* 2 pi) ad))
 )
 (princ (strcat "\n Arc length (1) = " (rtos D1) ", Complement (2) = " (rtos D2)))
 (setq D D1)
 (initget "1 2")
 (setq i (getkword "\n Dim which? [1 2] : "))
 (princ "\n Place dimension : ")
 (if (= i "2") (setq D D2))
 (command "_DIMANGULAR" "" cen pt1 pt2 "_T" (rtos D) pause "")
 (setq cen nil)
) ; while
(setvar "OSMODE" oldOs)
(setvar "CMDECHO" oldCmde)
(princ)
)

I need help in changing the code to do this:

- text to show fractions as horizontal;

- make option 1 as default (no need to ask for input);

 

Thank you for your help

Posted

take this part of the code out and it will stop asking and revert to 1

 (initget "1 2")
 (setq i (getkword "\n Dim which? [1 2] : "))
 (princ "\n Place dimension : ")
 (if (= i "2") (setq D D2))

Posted

Thanks Brian,

This one is solved.

What about the text ?

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