apsonwane Posted May 31, 2011 Posted May 31, 2011 Is it possible to change measured text in multiple dimentions to normal text in one command, so that when objects are scaled or streched, dimention text value dosn't change anymore? In short I am looking to convert dimention to number text. Thanks in advance, Ashish Quote
Tharwat Posted May 31, 2011 Posted May 31, 2011 Check this out . (defun c:Test (/ ss str) (if (and (setq str (getstring T "\n Enter Text:")) (setq ss (ssget "_:L" '((0 . "*DIMENSION")))) ) (command "_.DimEdit" "_New" str ss "") ) (princ) ) Tharwat Quote
Tiger Posted May 31, 2011 Posted May 31, 2011 you could...*shudder* *gasp* *swallow* explode the dimension.... Quote
Lee Mac Posted May 31, 2011 Posted May 31, 2011 I don't understand why you would want to do such a thing? This would accomplish the task... (defun c:test ( / ss i e ) (if (setq ss (ssget "_:L" '((0 . "*DIMENSION")))) (repeat (setq i (sslength ss)) (entupd (cdr (assoc -1 (entmod (subst (cons 1 (LM:GetDimensionString (setq e (ssname ss (setq i (1- i))))) ) (assoc 1 (setq e (entget e))) e ) ) ) ) ) ) ) (princ) ) (defun LM:GetDimensionString ( dim / dl db ds ) (if (and (wcmatch (cdr (assoc 0 (setq dl (entget dim)))) "*DIMENSION") (setq db (tblobjname "BLOCK" (cdr (assoc 2 dl)))) ) (while (and (setq db (entnext db)) (not ds)) (if (eq "MTEXT" (cdr (assoc 0 (setq dl (entget db))))) (setq ds (cdr (assoc 1 dl))) ) ) ) ds ) Quote
dbroada Posted May 31, 2011 Posted May 31, 2011 you could...*shudder* *gasp* *swallow* explode the dimension....I was going to suggest that but decided I didn't want a moderator telling me off. Quote
apsonwane Posted May 31, 2011 Author Posted May 31, 2011 Thanks Le Mac once again. This is exactly what I was looking for. The reson why I need this is, I always need to enlarge some portion of drawing in same sheet where I scale that portion of drawing keeping same dimention values. Cheers, Ashish Quote
ReMark Posted May 31, 2011 Posted May 31, 2011 Thanks Le Mac once again. This is exactly what I was looking for. The reson why I need this is, I always need to enlarge some portion of drawing in same sheet where I scale that portion of drawing keeping same dimention values. Cheers, Ashish That's why paper space layouts and "annotative scaling" was introduced so that you would not have to go through that. Why aren't you using the features built into 2010 to your advantage? You might as well be using AutoCAD release 9. Quote
pBe Posted May 31, 2011 Posted May 31, 2011 (defun c:test (/ selset Units DimValue DimValue DimPrec) (vl-load-com) (if (ssget '((0 . "DIMENSION"))) (progn (vlax-for Text (setq selset (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object)))) (setq Units (vla-get-UnitsFormat text) DimValue (vla-get-measurement text) DimPrec (vla-get-PrimaryUnitsPrecision text) ) (vla-put-TextOverride text (if (or (= Units 3) (= Units 4)) (rtos DimValue 4 DimPrec) (rtos DimValue 2 DimPrec) ) ) ) (vla-delete selset) ) ) ) Not thouroughly tested Quote
pBe Posted May 31, 2011 Posted May 31, 2011 That's why paper space layouts and "annotative scaling" was introduced so that you would not have to go through that. That is correct Quote
Lee Mac Posted May 31, 2011 Posted May 31, 2011 Not thouroughly tested Be aware that by using that method you will also have to account for DimPrefix, DimSuffix, Display of Alternate Units (and position [before/after primary]), AltPrefix, AltSuffix, AltUnits, AltPrecision, Tolerance Display, Tolerance types/justifications - oh, and not to mention any other MText formatting that the user has applied. Quote
alanjt Posted May 31, 2011 Posted May 31, 2011 Be aware that by using that method you will also have to account for DimPrefix, DimSuffix, Display of Alternate Units (and position [before/after primary]), AltPrefix, AltSuffix, AltUnits, AltPrecision, Tolerance Display, Tolerance types/justifications - oh, and not to mention any other MText formatting that the user has applied. Or anything the user just manually typed in, in addition to the . Quote
pBe Posted June 1, 2011 Posted June 1, 2011 Be aware that by using that method you will also have to account for DimPrefix, DimSuffix, Display of Alternate Units (and position [before/after primary]), AltPrefix, AltSuffix, AltUnits, AltPrecision, Tolerance Display, Tolerance types/justifications - oh, and not to mention any other MText formatting that the user has applied. I totally agree with those mentioned above, there's way too much factors to consider alright. Quote
pBe Posted June 1, 2011 Posted June 1, 2011 Or anything the user just manually typed in, in addition to the . and yeah..that too 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.