Author Topic: [HELP]About this project DIMENSION  (Read 1982 times)

0 Members and 1 Guest are viewing this topic.

myloveflyer

  • Newt
  • Posts: 152
[HELP]About this project DIMENSION
« on: January 27, 2010, 10:24:03 PM »
How to do this as the right of the mark use lisp?
« Last Edit: January 29, 2010, 03:13:45 AM by myloveflyer »
Never give up !

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: [HELP]About this project DIMENSION
« Reply #1 on: January 27, 2010, 11:40:04 PM »
That is an empty file.
It should be a lisp or DWG file and not both. :-o
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

myloveflyer

  • Newt
  • Posts: 152
Re: [HELP]About this project DIMENSION
« Reply #2 on: January 28, 2010, 04:26:02 AM »
sorry! CAB
Annex has been updated!
Never give up !

myloveflyer

  • Newt
  • Posts: 152
Re: [HELP]About this project DIMENSION
« Reply #3 on: January 28, 2010, 08:16:03 PM »
CAB, how can do automatic dimensioning?such as the center point coordinates and line intersections are found, how to find these points arranged, so to automate the labeling, can be a reference for an example of this map on the good, in this first thank the
Never give up !

fixo

  • Guest
Re: [HELP]About this project DIMENSION
« Reply #4 on: January 29, 2010, 05:56:58 AM »
How to do this as the right of the mark use lisp?


This one will do it what you want
Code: [Select]
(defun C:DRC (/ osm p1 p2 p3 p4 pt_list ss xlist ylist)
  (setq osm (getvar "osmode"))
  (setvar "osmode" 1)
(if (and
      (setq p1 (getpoint "\nPick lower left point of the rectangle: " )
    p3 (getpoint p1 "\nPick upper right point of the rectangle: ")
    p2 (list (car p3) (cadr p1)(caddr p1))
    p4 (list (car p1) (cadr p3)(caddr p1))
    )

      (setq ss (ssget "_W" p1 p3 (list (cons 0 "CIRCLE"))))
      )

  (progn
     
    (setq pt_list
   (mapcar (function (lambda (x)
       (cdr (assoc 10 x))))
   (mapcar 'entget
   (vl-remove-if
     'listp
     (mapcar 'cadr
     (ssnamex ss)
     )
     )
   )
   )
  )


    (setq pt_list
   (vl-sort pt_list
    (function (lambda (a b) (>= (car a) (car b)))
      )
    )
  )

    (setq xlist
   (vl-sort
     (vl-remove-if
       (function (lambda (a)
   (not (equal (car a) (caar pt_list) 0.001))))
       pt_list
       )
     (function (lambda (p q)
(> (cadr p) (cadr q)))))
  )
    (setq xlist (append (list p3) xlist)
  xlist (append xlist (list p2))
  xlist (mapcar (function (lambda(x)(list (car p2)(cadr x)(caddr x))))
xlist
)
  )

    (setq pt_list
   (vl-sort pt_list
    (function (lambda (a b) (<= (cadr a) (cadr b)))
      )
    )
  )

    (setq ylist
   (vl-sort
     (vl-remove-if
       (function (lambda (a)
   (not (equal (cadr a) (cadar pt_list) 0.001))))
       pt_list
       )
     (function (lambda (p q)
(< (car p) (car q)))))
  )
   
    (setq ylist (append (list p1) ylist)
  ylist (append ylist (list p2))
  ylist (mapcar (function (lambda(x)(list (car x)(cadr p1)(caddr x))))
ylist
)
  )
   
    (command "._undo" "_begin")
   
    (mapcar (function (lambda (x y)
(command "._dimlinear" "_non" x "_non" y  "V"
"_non" (mapcar '+ (list 250. 0. 0.)
(mapcar (function (lambda(a b)
     (/ (+ a b) 2.)))
x
y
)
)
)
)
      )
    (cdr xlist)
    xlist
   
    )
   
    (mapcar (function (lambda (x y)
(command "._dimlinear" "_non" x "_non" y "H"
"_non" (mapcar '+ (list 0. -250. 0.)
(mapcar (function (lambda(a b)
     (/ (+ a b) 2.)))
x
y
)
)
)
)
      )
    (cdr ylist)
    ylist
   
    )
   
    (command "._dimlinear" "_non" p3 "_non" p2
"_non" (mapcar '+ (list 500. 0. 0.)
(mapcar (function (lambda(a b)
     (/ (+ a b) 2.)))
p3
p2
)


)
)
    (command "._dimlinear" "_non" p1 "_non" p2
"_non" (mapcar '+ (list 0. -500. 0.)
(mapcar (function (lambda(a b)
     (/ (+ a b) 2.)))
p1
p2
)

)
)
   
(command "._undo" "_end")

    )

  )
  (setvar "osmode" osm)
  (princ)
  )

~'J'~

myloveflyer

  • Newt
  • Posts: 152
Re: [HELP]About this project DIMENSION
« Reply #5 on: January 30, 2010, 01:42:42 AM »
fixo,Nice work!
Thank you very much !
For the outside box is not rectangular can also perform (in CAD2004, the other did not test)!
Never give up !

fixo

  • Guest
Re: [HELP]About this project DIMENSION
« Reply #6 on: January 30, 2010, 03:05:29 AM »
fixo,Nice work!
Thank you very much !
For the outside box is not rectangular can also perform (in CAD2004, the other did not test)!
Glad if that helps
Cheers :0

~'J'~