djx084 Posted April 2, 2014 Posted April 2, 2014 I need help, I have this lisp "PDIM", but it is necessary that all dimensions are inside the contour and not like the picture 1, can this be done? Thank you all for reply... lisp PDIM : http://www.sendspace.com/file/3txh6a picture 1 : http://www.sendspace.com/file/p3upgc picture how it should look : http://www.sendspace.com/file/y9q7ra Quote
Tharwat Posted April 2, 2014 Posted April 2, 2014 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 . Quote
djx084 Posted April 2, 2014 Author Posted April 2, 2014 thx I had trouble to put pictures and LSP.... Quote
Tharwat Posted April 2, 2014 Posted April 2, 2014 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 . Quote
Tharwat Posted April 2, 2014 Posted April 2, 2014 I just downloaded the files and would post them for user whom interested in help . Picture -1 Picture -2 Quote
marko_ribar Posted April 2, 2014 Posted April 2, 2014 (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 April 2, 2014 by marko_ribar added option [Outside/Inside] dimensioning Quote
marko_ribar Posted April 4, 2014 Posted April 4, 2014 Nema na cemu drugar, hvala i tebi na lepim zeljama... Quote
maahee Posted July 7, 2023 Posted July 7, 2023 (edited) please 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 July 7, 2023 by maahee Quote
Steven P Posted July 7, 2023 Posted July 7, 2023 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? Quote
Tharwat Posted July 7, 2023 Posted July 7, 2023 It seems to me that you are working with dimensioning lots or a similar field, anyway my initial program in the following link can be modified to suit your needs and it is not freeware. https://autolispprograms.wordpress.com/dimensioning-lots-with-area/ Quote
maahee Posted July 8, 2023 Posted July 8, 2023 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 Quote
maahee Posted July 9, 2023 Posted July 9, 2023 On 7/8/2023 at 11:39 AM, maahee said: Also Measure arc dimensions Quote
maahee Posted August 23, 2023 Posted August 23, 2023 (edited) I need help to alternavite mirrir object like show in attached file 1. Extrim and Tan fuction showing error bm.pdf Edited August 23, 2023 by maahee Quote
Recommended Posts
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.