Jump to content

Recommended Posts

Posted

An advise , just upload the lisp file with the two picture because most of users do not like downloading files from unknown website that may hold any threats .

Posted

thx :) I had trouble to put pictures and LSP....

Posted
thx :) I had trouble to put pictures and LSP....

I see , maybe because you have not reached the ten posts at least to be able to attach any file .

Posted

I just downloaded the files and would post them for user whom interested in help .

 

Picture -1

 

Picture - 1.jpg

Picture -2

 

Picture - 2.jpg

Posted (edited)

Here, I've modified pdim.lsp for you... HTH, M.R.

 

(defun c:pdim ( / ListClockwise-p ch plSet pLlst vLst oldOsn cAng cDis cPt )

 (defun ListClockwise-p ( lst / z vlst )
   (vl-catch-all-apply 'minusp 
     (list
       (if 
         (not 
           (equal 0.0
             (setq z
               (apply '+
                 (mapcar 
                   (function
                     (lambda (u v)
                       (- (* (car  u) (cadr  v)) (* (car  v) (cadr  u)))
                     )
                   )
                   (setq vlst
                     (mapcar
                       (function
                         (lambda (a b) (mapcar '- b a))
                       )
                       (mapcar (function (lambda (x) (car lst))) lst) 
                       (cdr (reverse (cons (car lst) (reverse lst))))
                     )
                   )
                   (cdr (reverse (cons (car vlst) (reverse vlst))))
                 )
               )
             ) 1e-6
           )
         )
         z
         (progn
           (prompt "\n\nChecked vectors are colinear - unable to determine clockwise-p of list")
           nil
         )
       )
     )
   )
 )

 (initget 1 "Outside Inside")
 (setq ch (getkword "\nChoose on which side to put dimensions [Outside/Inside] : "))
 (princ "\n<<< Select LwPolyline(s) for dimensioning >>> ")
 (if (setq plSet (ssget '((0 . "LWPOLYLINE"))))
   (progn
     (setq pLlst (vl-remove-if 'listp
                        (mapcar 'cadr(ssnamex plSet)))
           oldOsn (getvar "OSMODE")
     ); end setq
     (setvar "OSMODE" 0) (setvar "CMDECHO" 0)
     (command "_.undo" "_be")
     (foreach pl pLlst
      (setq vLst (mapcar '(lambda( x ) (trans x 0 1)) 
                   (mapcar 'cdr (vl-remove-if-not '(lambda( x ) (= 10 (car x)))
                                  (entget pl)
                                )
                   )
                 )
      ); end setq
      (if (equal (logand (cdr (assoc 70 (entget pl))) 1) 1)
       (setq vLst (append vLst (list (car vLst))))
      ); end if
      (if (not (ListClockwise-p vLst)) (setq vLst (reverse vLst)))
      (while (< 1 (length vLst))
       (setq cAng (angle (car vLst) (cadr vLst))
               cDis (/ (distance (car vLst) (cadr vLst)) 2.0)
       )
;        (if (>= (caar vLst) (caadr vLst))
;         (setq cAng (- cAng pi))
;        ); end if
       (if (eq ch "Inside")
        (setq cPt (polar (polar (car vLst) cAng cDis) (- cAng (* 0.5 pi)) (* 2.5 (getvar "DIMTXT")))); end setq
        (setq cPt (polar (polar (car vLst) cAng cDis) (+ cAng (* 0.5 pi)) (* 2.5 (getvar "DIMTXT")))); end setq
       ); end if
       (command "_.dimaligned" (car vLst) (cadr vLst) cPt)
       (setq vLst (cdr vLst))
      ); end while
     ); end foreach
     (command "_.undo" "_e")
     (setvar "OSMODE" oldOsn) (setvar "CMDECHO" 1)
   ); end progn
 ); end if
 (princ)
); end of c:pdim

Edited by marko_ribar
added option [Outside/Inside] dimensioning
Posted

Marko, veeeeeeliko hvala na lispu! :-)

Posted

Nema na cemu drugar, hvala i tebi na lepim zeljama...

  • 9 years later...
Posted (edited)

Pdim.thumb.jpg.c64d843b29b8479b6ef4dbba24be4df6.jpgplease rewrite above lisp code add with

1. associate dimension style

2. Outside or inside option

3. remove duplicate  dimension create by two or more adjacent close polyline (same size) 

Edited by maahee
Posted

1. What are your skills with LISPs like, if I give you a link will that help you out?

A simple internet search pulls up this thread (https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-and-associative-dimensions/td-p/2185589#:~:text=They can be associated but the process is,of line%3A ")) (command "line" a b "")) - to show that adding "end" in the line (command "_.dimaligned" (car vLst)  (cadr vLst) cPt) will work:

(command "_.dimaligned" "end" (car vLst) "end" (cadr vLst) cPt)

 

2. The LISP asks this

 

3. will need some more information - how 'close' do the dimensions need to be?

Posted
12 hours ago, Steven P said:

1. What are your skills with LISPs like, if I give you a link will that help you out?

A simple internet search pulls up this thread (https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-and-associative-dimensions/td-p/2185589#:~:text=They can be associated but the process is,of line%3A ")) (command "line" a b "")) - to show that adding "end" in the line (command "_.dimaligned" (car vLst)  (cadr vLst) cPt) will work:

(command "_.dimaligned" "end" (car vLst) "end" (cadr vLst) cPt)

 

2. The LISP asks this

 

3. will need some more information - how 'close' do the dimensions need to be?

distance between dimension line to polyline is equal to height of dimension text

Posted
On 7/8/2023 at 11:39 AM, maahee said:

Also Measure arc dimensions 

 

  • 1 month later...
Posted (edited)

 

I need help to alternavite mirrir object like show in attached file

1. Extrim and Tan fuction showing error

 

bm.pdf

Edited by maahee

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