AUTOMATIC DIMENSION SELECT OBJECT LISP

AUTOMATIC DIMENSION SELECT OBJECT LISP

Gaganpatel
Collaborator Collaborator
19,923 Views
38 Replies
Message 1 of 39

AUTOMATIC DIMENSION SELECT OBJECT LISP

Gaganpatel
Collaborator
Collaborator

 

Dear Sir,

 

I want to rectangle inner all attributes circle to attributes circle dimension automatic.

Please help me.

0 Likes
19,924 Views
38 Replies
Replies (38)
Message 21 of 39

Moshe-A
Mentor
Mentor

forgot to add ...  you do not have to set the ucs before, start with ucs world and fdall will do the rest.

0 Likes
Message 22 of 39

Gaganpatel
Collaborator
Collaborator

Dear Sir,

 

This program is working good but i want to this type dimension on this program.

Please find the attached example drawing.

Please help me.

0 Likes
Message 23 of 39

Gaganpatel
Collaborator
Collaborator

Dear Sir,

 

Please help.

0 Likes
Message 24 of 39

Gaganpatel
Collaborator
Collaborator

 

Dear Sir,

 

ordinate dimension program is working good but i want to example type dimension on this program.

Please find the attached example drawing.

Please help me.

 

0 Likes
Message 25 of 39

Gaganpatel
Collaborator
Collaborator

 

 Dear Sir,

 

Please help and modify the program.

0 Likes
Message 26 of 39

Moshe-A
Mentor
Mentor

@Gaganpatel  hi,

 

how do you do?

wonder what would be you next request? Smiley LOL

 

moshe

 

0 Likes
Message 27 of 39

Moshe-A
Mentor
Mentor

@Gaganpatel ,

 

check this update...i add two more commands:

1) FDLIN   which preforms the linear dimensions

2) FDORD which preforms the ordinate dimensions

 

and the FDALL preforms 1+ 2

 

enjoy

moshe

 

0 Likes
Message 28 of 39

Gaganpatel
Collaborator
Collaborator

Dear Sir,

Thank you very much.


This programing very good but something problems.

1.Ordinate dimension -OK

2.Liner dimension mixed ordinate dimension and right side ,top side liner dimension are separately.

3. FDALL dimension ordinate dimension ok,right side ,top side liner dimension are separately.

4. This Program use auto cad 2014 to higher version usable .

Please find the attached example video

Please modify ,Help me.

0 Likes
Message 29 of 39

Moshe-A
Mentor
Mentor
Accepted solution

@Gaganpatel ,

 

you are right, attached the fix

 

 

0 Likes
Message 30 of 39

Gaganpatel
Collaborator
Collaborator

 

THANK YOU VERY MUCH

THANKS

 

THIS PROGRAM IS WORKING VERY GOOD.

0 Likes
Message 31 of 39

Gaganpatel
Collaborator
Collaborator

 

Dear Sir,

 

how can possible this lisp 5type of block name process.

Please modify lisp share.

0 Likes
Message 32 of 39

Gaganpatel
Collaborator
Collaborator

Dear Sir,

 

Please modify this lisp, 5nos different type of block name input in this lisp please help sir.

0 Likes
Message 33 of 39

Gaganpatel
Collaborator
Collaborator

Dear Sir,

 

Please modify this lisp.

5nos. different type of circle block name input please help.

0 Likes
Message 34 of 39

Anonymous
Not applicable

Dear Sir,

 

how to fix this problem?

tnx

_______VRTLIB-1$# d ØLOAD((:protected . T) (:active-x . T) (:separate-namespace) (:load-file-list (:fas "fdall")))³" 2FDALL
FAS4-FILE ; Do not change it!
4072
217 $ Æ QÅ 
W˜  Ä QÅ 
W  Ã QÅ 
 Á À ¿ ¾ 5½ 5¼ 5» ] º  \ g¹ \ (º \ )] º 5¹ ¸ 2
¸ 5· 5¶ µ 2 ¸ 5· 5¶ ´ µ 5¿ ´ 5¿ ³ 5² hM µ 5± ´ 5± ³ 5² h  h W _____

0 Likes
Message 35 of 39

m.pahee
Explorer
Explorer

Is it possible to share lsp file of this solution?

 

Thanks

0 Likes
Message 36 of 39

Gaganpatel
Collaborator
Collaborator

Dear Sir,

 

Please modify this lisp, 5nos different type of block name input in this lisp please help sir.

and using auto cad 2013.

 
0 Likes
Message 37 of 39

ВeekeeCZ
Consultant
Consultant

@Gaganpatel wrote:

...

Please modify this lisp, 5nos different type of block name input in this lisp please help sir.

...

 

You keep saying that. What that means? Post an xample. There is now reason to limit a routine to use only for some names...

I really did not try Moshe's routine.

0 Likes
Message 38 of 39

ВeekeeCZ
Consultant
Consultant

Here's my version. Commands BDim and BdimSet. You can adjust defaults as prefered.

HTH

 

(vl-load-com)

(defun c:BDimSet nil (BDimSet) (c:BDim) (princ))

(defun BDimSet nil
  
  (setq *bd-type* "Both")  ; default type
  (setq *bd-offset* 30.)   ; default offset
  
  (initget "Ordinate Continuous Both")
  (setq *bd-type* (cond ((getkword (strcat "\nSpecify DIM type [Ordinate/Continuous/Both] <" *bd-type* ">: ")))
			(*bd-type*)))
  (setq *bd-offset* (cond ((getdist (strcat "\nSpecify offset <" (rtos *bd-offset* 2) ">: ")))
			  (*bd-offset*)))
  (and *bd-type* *bd-offset*))

; ---------------------------------------------------------------------------------------------------------

(defun c:BDim (/ *error* doc das LM:ssboundingbox ss sl bb mr mt ml mb sp i ed ep lp)
  
  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
      (princ (strcat "\nError: " errmsg)))
    (if lp (mapcar 'entdel lp))
    (if das (setvar 'dimassoc das))
    (if doc (vla-endundomark doc))
    (princ))
  
  ;; Selection Set Bounding Box  -  Lee Mac  ;; http://www.lee-mac.com/ssboundingbox.html
  (defun LM:ssboundingbox ( sel / idx llp ls1 ls2 obj urp )
    (repeat (setq idx (sslength sel))
      (setq obj (vlax-ename->vla-object (ssname sel (setq idx (1- idx)))))
      (if (and (vlax-method-applicable-p obj 'getboundingbox)
	       (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-getboundingbox (list obj 'llp 'urp)))))
	(setq ls1 (cons (vlax-safearray->list llp) ls1)
	      ls2 (cons (vlax-safearray->list urp) ls2))))
    (if (and ls1 ls2)
      (mapcar '(lambda ( a b ) (apply 'mapcar (cons a b))) '(min max) (list ls1 ls2))))
  
  
  
  (if (and (or (and *bd-type* *bd-offset*)
	       (BDimSet))
	   (princ (strcat "\nCurrent setting: Type=" *bd-type* ", Offset=" (rtos *bd-offset* 2) ". Call 'BDimSet' for reset."))
	   (setq ss (ssget '((0 . "INSERT,LINE"))))
	   (setq sl (ssget "_P" '((0 . "LINE"))))
	   (setq bb (LM:ssboundingbox sl))
	   (setq mr (list (caadr bb) (/ (+ (cadar bb) (cadadr bb)) 2))) ; right
	   (setq mt (list (/ (+ (caar bb) (caadr bb)) 2) (cadadr bb)))  ; top
	   (setq ml (list (caar bb) (/ (+ (cadar bb) (cadadr bb)) 2))) ; left
	   (setq mb (list (/ (+ (caar bb) (caadr bb)) 2) (cadar bb)))  ; bottom
	   (setq sp (ssadd))
	   (setq das (getvar 'dimassoc))
	   (setvar 'dimassoc 1)
	   )
    (progn
      (vla-startundomark (setq doc (vla-get-activedocument (vlax-get-acad-object))))
      
      (repeat (setq i (sslength ss))
	(and (setq ed (entget (ssname ss (setq i (1- i)))))
	     (= "INSERT" (cdr (assoc 0 ed)))
	     (setq ep (entmakex (list '(0 . "POINT") (assoc 10 ed))))
	     (ssadd ep sp)
	     (setq lp (cons ep lp))))
      
      (if (wcmatch *bd-type* "Continuous,Both")
	(command "_.qdim" sl sp "" "_c" (mapcar '+ (trans ml 0 1) (list (- *bd-offset*) 0))
		 "_.qdim" sl sp "" "_c" (mapcar '+ (trans mb 0 1) (list 0 (- *bd-offset*)))
		 "_.qdim" sl 	"" "_c" (mapcar '+ (trans mr 0 1) (list *bd-offset* 0))
		 "_.qdim" sl 	"" "_c" (mapcar '+ (trans mt 0 1) (list 0 *bd-offset*))))
      
      (if (wcmatch *bd-type* "Ordinate,Both")
	(command "_.qdim" sl sp "" "_p" "_non" (trans (car bb) 0 1) "_o" "_non" (mapcar '+ (trans ml 0 1) (list (- (* 2 *bd-offset*)) 0))
		 "_.qdim" sl sp "" "_o" "_non" (mapcar '+ (trans mb 0 1) (list 0 (- (* 2 *bd-offset*))))
		 "_.qdim" sl 	"" "_o" "_non" (mapcar '+ (trans mr 0 1) (list (* 2 *bd-offset*) 0))
		 "_.qdim" sl 	"" "_o" "_non" (mapcar '+ (trans mt 0 1) (list 0 (* 2 *bd-offset*)))))
      ))
  (*error* "end")
  )

 

0 Likes
Message 39 of 39

Gaganpatel
Collaborator
Collaborator

Dear Sir,

Thanks for help.

Programming dimension are overwrite.

0 Likes