apsonwane Posted May 31, 2011 Share 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 Link to comment Share on other sites More sharing options...
Tharwat Posted May 31, 2011 Share 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 Link to comment Share on other sites More sharing options...
Tiger Posted May 31, 2011 Share Posted May 31, 2011 you could...*shudder* *gasp* *swallow* explode the dimension.... Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 31, 2011 Share 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 Link to comment Share on other sites More sharing options...
dbroada Posted May 31, 2011 Share 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 Link to comment Share on other sites More sharing options...
apsonwane Posted May 31, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
ReMark Posted May 31, 2011 Share 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 Link to comment Share on other sites More sharing options...
pBe Posted May 31, 2011 Share 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 Link to comment Share on other sites More sharing options...
pBe Posted May 31, 2011 Share 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 Link to comment Share on other sites More sharing options...
Lee Mac Posted May 31, 2011 Share 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 Link to comment Share on other sites More sharing options...
alanjt Posted May 31, 2011 Share 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 Link to comment Share on other sites More sharing options...
pBe Posted June 1, 2011 Share 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 Link to comment Share on other sites More sharing options...
pBe Posted June 1, 2011 Share Posted June 1, 2011 Or anything the user just manually typed in, in addition to the . and yeah..that too Quote Link to comment Share on other sites More sharing options...
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.