JeepMaster Posted January 4, 2010 Posted January 4, 2010 Does anybody know if there's an easy way to scale a drawing from 1:100 to 1:50 while the background xref stays the same scale? The basepoint of each blocks/text/... will have to be the same, so "scale" command will not work as it will just "shrink" the drawing. I know I'll probably have to shift a few things after the change. The problem I have is I have a about ten 1:100 drawings and need to do MANY detail layouts of different rooms in 1:50 scale on each drawing. Everything is already drawn in 1:100 scale and I need to make it 1:50 scale. Another problem I see is that the blocks are in scale=2 while the text is in 200mm height, so not exactly straight forward. So basically I need to scale the whole drawing down while keeping the basepoints of all the blocks/text/leaders/lines,etc the same. Please help. Quote
lpseifert Posted January 4, 2010 Posted January 4, 2010 Can't you use viewports with different scale factors? Quote
alanjt Posted January 4, 2010 Posted January 4, 2010 Can't you use viewports with different scale factors? Would def. make life a lot easier. Quote
JeepMaster Posted January 4, 2010 Author Posted January 4, 2010 Haaa, I wish it was that simple. Our company standard has certain size of block/text/arrow size/etc. So if I just use the viewport, everything will be double in size. Quote
Cad64 Posted January 4, 2010 Posted January 4, 2010 Everything is already drawn in 1:100 scale and I need to make it 1:50 scale. I don't know if you created these drawings, or if you inherited them, but this is a perfect example of why you should Always draw at 1:1. :wink: Quote
JeepMaster Posted January 4, 2010 Author Posted January 4, 2010 Actually, this is a floor plan with electrical symbols. So can't really draw 1:1. If it was a detail of an equpiment, then yes always 1:1. Quote
Lee Mac Posted January 5, 2010 Posted January 5, 2010 Written quickly, just an idea really, may need more filters: (defun c:sclAll (/ *error* BLKS DOC ENT I MA MI OBJ PTLST SCL SS UF) (vl-load-com) (defun *error* (msg) (and uF (vla-EndUndoMark doc)) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ)) (setq blks (vla-get-Blocks (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))))) (initget 7) (setq scl (getreal "\nSpecify Scale Factor: ")) (if (setq i -1 ss (ssget "_:L")) (progn (setq uF (not (vla-StartUndoMark doc))) (while (setq ent (ssname ss (setq i (1+ i)))) (setq obj (vlax-ename->vla-object ent)) (cond ( (eq "INSERT" (cdr (assoc 0 (entget ent)))) (if (not (eq :vlax-true (vla-get-isXRef (vla-item blks (vla-get-Name obj))))) (vla-ScaleEntity obj (vla-get-InsertionPoint obj) scl))) ( (wcmatch (cdr (assoc 0 (entget ent))) "*TEXT") (vla-ScaleEntity obj (vlax-get-property obj (if (eq "AcDbText" (vla-get-ObjectName obj)) (if (eq acAlignmentLeft (vla-get-Alignment obj)) 'InsertionPoint 'TextAlignmentPoint) 'InsertionPoint)) scl)) (t (vla-getBoundingBox obj 'Mi 'Ma) (setq ptLst (mapcar (function vlax-safearray->list) (list Mi Ma))) (vla-ScaleEntity obj (vlax-3D-point (polar (car ptLst) (apply (function angle) ptLst) (/ (apply (function distance) ptLst) 2.))) scl)))) (setq UF (vla-EndUndoMark doc)))) (princ)) Quote
JeepMaster Posted January 5, 2010 Author Posted January 5, 2010 Written quickly, just an idea really, may need more filters: (defun c:sclAll (/ *error* BLKS DOC ENT I MA MI OBJ PTLST SCL SS UF) (vl-load-com) (defun *error* (msg) (and uF (vla-EndUndoMark doc)) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ)) (setq blks (vla-get-Blocks (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))))) (initget 7) (setq scl (getreal "\nSpecify Scale Factor: ")) (if (setq i -1 ss (ssget "_:L")) (progn (setq uF (not (vla-StartUndoMark doc))) (while (setq ent (ssname ss (setq i (1+ i)))) (setq obj (vlax-ename->vla-object ent)) (cond ( (eq "INSERT" (cdr (assoc 0 (entget ent)))) (if (not (eq :vlax-true (vla-get-isXRef (vla-item blks (vla-get-Name obj))))) (vla-ScaleEntity obj (vla-get-InsertionPoint obj) scl))) ( (wcmatch (cdr (assoc 0 (entget ent))) "*TEXT") (vla-ScaleEntity obj (vlax-get-property obj (if (eq "AcDbText" (vla-get-ObjectName obj)) (if (eq acAlignmentLeft (vla-get-Alignment obj)) 'InsertionPoint 'TextAlignmentPoint) 'InsertionPoint)) scl)) (t (vla-getBoundingBox obj 'Mi 'Ma) (setq ptLst (mapcar (function vlax-safearray->list) (list Mi Ma))) (vla-ScaleEntity obj (vlax-3D-point (polar (car ptLst) (apply (function angle) ptLst) (/ (apply (function distance) ptLst) 2.))) scl)))) (setq UF (vla-EndUndoMark doc)))) (princ)) Wow Lee, thanks so much. That seems to do the trick for the most part. The only thing I notice is the arrows gets screw up. The leader lines changes somehow. Also, can the arrow head size be scaled by the same factor? You are the best! Quote
Lee Mac Posted January 5, 2010 Posted January 5, 2010 Might have to just add a filter for them in the COND statement, and do them another way. (defun c:sclAll (/ *error* BLKS DOC ENT I MA MI OBJ PTLST SCL SS UF) (vl-load-com) (defun *error* (msg) (and uF (vla-EndUndoMark doc)) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ)) (setq blks (vla-get-Blocks (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))))) (initget 7) (setq scl (getreal "\nSpecify Scale Factor: ")) (if (setq i -1 ss (ssget "_:L")) (progn (setq uF (not (vla-StartUndoMark doc))) (while (setq ent (ssname ss (setq i (1+ i)))) (setq obj (vlax-ename->vla-object ent)) (cond ( (eq "INSERT" (cdr (assoc 0 (entget ent)))) (if (not (eq :vlax-true (vla-get-isXRef (vla-item blks (vla-get-Name obj))))) (vla-ScaleEntity obj (vla-get-InsertionPoint obj) scl))) ( (wcmatch (cdr (assoc 0 (entget ent))) "*LEADER")) ( (wcmatch (cdr (assoc 0 (entget ent))) "*TEXT") (vla-ScaleEntity obj (vlax-get-property obj (if (eq "AcDbText" (vla-get-ObjectName obj)) (if (eq acAlignmentLeft (vla-get-Alignment obj)) 'InsertionPoint 'TextAlignmentPoint) 'InsertionPoint)) scl)) (t (vla-getBoundingBox obj 'Mi 'Ma) (setq ptLst (mapcar (function vlax-safearray->list) (list Mi Ma))) (vla-ScaleEntity obj (vlax-3D-point (polar (car ptLst) (apply (function angle) ptLst) (/ (apply (function distance) ptLst) 2.))) scl)))) (setq UF (vla-EndUndoMark doc)))) (princ)) Quote
flowerrobot Posted January 6, 2010 Posted January 6, 2010 Haaa, I wish it was that simple. Our company standard has certain size of block/text/arrow size/etc. So if I just use the viewport, everything will be double in size. Annatotive? Quote
JeepMaster Posted January 6, 2010 Author Posted January 6, 2010 You mean annotative. Yes, it's an electrical power plan for a building, so it will have text, electrical symbols, notes with leaders, etc. Lee, the only thing I can't figure out is how to include the arrowhead on the leaders so the arrowhead size will be scaled up/down too. Right now after I run the lisp, I'll have to select all the leaders and manualy change the arrow head size to the correct size from the properties window. DIMASZ only works if the leaders are drawn afterwards. Quote
Lee Mac Posted January 6, 2010 Posted January 6, 2010 Ok, not sure if this suits? (defun c:sclAll (/ *error* BLKS DOC ENT I MA MI OBJ PTLST SCL SS UF) (vl-load-com) (defun *error* (msg) (and uF (vla-EndUndoMark doc)) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ)) (setq blks (vla-get-Blocks (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))))) (initget 7) (setq scl (getreal "\nSpecify Scale Factor: ")) (if (setq i -1 ss (ssget "_:L")) (progn (setq uF (not (vla-StartUndoMark doc))) (while (setq ent (ssname ss (setq i (1+ i)))) (setq obj (vlax-ename->vla-object ent)) (cond ( (eq "INSERT" (cdr (assoc 0 (entget ent)))) (if (not (eq :vlax-true (vla-get-isXRef (vla-item blks (vla-get-Name obj))))) (vla-ScaleEntity obj (vla-get-InsertionPoint obj) scl))) ( (wcmatch (cdr (assoc 0 (entget ent))) "*TEXT") (vla-ScaleEntity obj (vlax-get-property obj (if (eq "AcDbText" (vla-get-ObjectName obj)) (if (eq acAlignmentLeft (vla-get-Alignment obj)) 'InsertionPoint 'TextAlignmentPoint) 'InsertionPoint)) scl)) (t (vla-getBoundingBox obj 'Mi 'Ma) (setq ptLst (mapcar (function vlax-safearray->list) (list Mi Ma))) (vla-ScaleEntity obj (vlax-3D-point (polar (car ptLst) (apply (function angle) ptLst) (/ (apply (function distance) ptLst) 2.))) scl) (if (wcmatch (cdr (assoc 0 (entget ent))) "*LEADER") (vla-put-ArrowHeadSize obj (* (vla-get-ArrowHeadSize obj) scl)))))) (setq UF (vla-EndUndoMark doc)))) (princ)) Quote
JeepMaster Posted January 6, 2010 Author Posted January 6, 2010 Thanks Lee for the quick response, this seems work for the arrow head sizing, but the leaders are back to being screwy again like what happen from the first version of this lisp. The middle points of the leader are moved. Maybe if you can use the same method on the arrowheads only but added to the previous version. This lisp is way above my skills. Quote
Lee Mac Posted January 6, 2010 Posted January 6, 2010 Thanks Lee for the quick response, this seems work for the arrow head sizing, but the leaders are back to being screwy again like what happen from the first version of this lisp. The middle points of the leader are moved. Maybe if you can use the same method on the arrowheads only but added to the previous version. This lisp is way above my skills. Bear in mind that the other LISP doesn't scale the leaders at all... This one scales the Leaders using the mid-point of the bounding box. I shall try one more Quote
Lee Mac Posted January 6, 2010 Posted January 6, 2010 If this doesn't work, then I don't know what to do... (defun c:sclAll (/ *error* BLKS DOC ENT I MA MI OBJ PTLST SCL SS UF) (vl-load-com) (defun *error* (msg) (and uF (vla-EndUndoMark doc)) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ)) (defun vlax-list->3D-point (lst) (if lst (cons (list (car lst) (cadr lst) (caddr lst)) (vlax-list->3D-point (cdddr lst))))) (setq blks (vla-get-Blocks (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))))) (initget 7) (setq scl (getreal "\nSpecify Scale Factor: ")) (if (setq i -1 ss (ssget "_:L")) (progn (setq uF (not (vla-StartUndoMark doc))) (while (setq ent (ssname ss (setq i (1+ i)))) (setq obj (vlax-ename->vla-object ent)) (cond ( (eq "INSERT" (cdr (assoc 0 (entget ent)))) (if (not (eq :vlax-true (vla-get-isXRef (vla-item blks (vla-get-Name obj))))) (vla-ScaleEntity obj (vla-get-InsertionPoint obj) scl))) ( (eq (cdr (assoc 0 (entget ent))) "LEADER") (vla-ScaleEntity obj (vlax-3D-point (last (vlax-list->3D-point (vlax-safearray->list (vlax-variant-value (vlax-get-property obj 'Coordinates)))))) scl) (vla-put-ArrowHeadSize obj (* (vla-get-ArrowHeadSize obj) scl))) ( (eq (cdr (assoc 0 (entget ent))) "MULTILEADER") (vla-ScaleEntity obj (vlax-3D-point (last (vlax-list->3D-point (vlax-safearray->list (vlax-variant-value (vlax-invoke-method obj 'GetLeaderLineVertices 0)))))) scl)) ( (wcmatch (cdr (assoc 0 (entget ent))) "*TEXT") (vla-ScaleEntity obj (vlax-get-property obj (if (eq "AcDbText" (vla-get-ObjectName obj)) (if (eq acAlignmentLeft (vla-get-Alignment obj)) 'InsertionPoint 'TextAlignmentPoint) 'InsertionPoint)) scl)) (t (vla-getBoundingBox obj 'Mi 'Ma) (setq ptLst (mapcar (function vlax-safearray->list) (list Mi Ma))) (vla-ScaleEntity obj (vlax-3D-point (polar (car ptLst) (apply (function angle) ptLst) (/ (apply (function distance) ptLst) 2.))) scl)))) (setq UF (vla-EndUndoMark doc)))) (princ)) Quote
JeepMaster Posted January 6, 2010 Author Posted January 6, 2010 Thanks Lee again. It seems like the mid point is moved further away from the original spot than the previous version. Maybe whatever you did, do it the opposite?!? Or maybe I'm just talking out of my @ss. Quote
Lee Mac Posted January 6, 2010 Posted January 6, 2010 I just the start vertex of the Leader Line, i.e. the arrow point. I shall try the end, as its not too hard to incorporate. Quote
JeepMaster Posted January 6, 2010 Author Posted January 6, 2010 Doesn't seem to work either. Leaders are still getting wired mid point. Its ok if it's too much. I don't want waste too much of your time. Thanks for trying Lee. Quote
flowerrobot Posted January 7, 2010 Posted January 7, 2010 You mean annotative. Yes, it's an electrical power plan for a building, so it will have text, electrical symbols, notes with leaders, etc. Blocks(symbols), Text, Leaders, all will work in annotative 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.