Jump to content

Modify dimension text


RepCad

Recommended Posts

Hello everyone, 
I'm trying to change the text of a aligned dimension with this function :  (real text is "106")
 

(vlax-put dimobj 'Measurement 15)

 

This error is returned
; error: Invalid number of parameters

 

I got the parameter from this dimension properties : 
 

Select object: ; IAcadDimAligned: AutoCAD Aligned Dimension Interface
; Property values:
;   AltRoundDistance = 0.0
;   AltSubUnitsFactor = 100.0
;   AltSubUnitsSuffix = ""
;   AltSuppressLeadingZeros = 0
;   AltSuppressTrailingZeros = 0
;   AltSuppressZeroFeet = -1
;   AltSuppressZeroInches = -1
;   AltTextPrefix = ""
;   AltTextSuffix = ""
;   AltTolerancePrecision = 2
;   AltToleranceSuppressLeadingZeros = 0
;   AltToleranceSuppressTrailingZeros = 0
;   AltToleranceSuppressZeroFeet = -1
;   AltToleranceSuppressZeroInches = -1
;   AltUnits = 0
;   AltUnitsFormat = 2
;   AltUnitsPrecision = 2
;   AltUnitsScale = 25.4
;   Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff681bb5e50>
;   Arrowhead1Block = ""
;   Arrowhead1Type = 0
;   Arrowhead2Block = ""
;   Arrowhead2Type = 0
;   ArrowheadSize = 20.0
;   DecimalSeparator = "."
;   DimConstrDesc = Exception occurred
;   DimConstrExpression = Exception occurred
;   DimConstrForm = 0
;   DimConstrName = Exception occurred
;   DimConstrReference = 0
;   DimConstrValue = Exception occurred
;   DimensionLineColor = 256
;   DimensionLineExtend = 0.0
;   DimensionLinetype = "ByLayer"
;   DimensionLineWeight = -1
;   DimLine1Suppress = 0
;   DimLine2Suppress = 0
;   DimLineInside = 0
;   DimTxtDirection = 0
;   Document (RO) = #<VLA-OBJECT IAcadDocument 000002d38cf026e8>
;   EntityTransparency = "0"
;   ExtensionLineColor = 256
;   ExtensionLineExtend = 0.18
;   ExtensionLineOffset = 0.0
;   ExtensionLineWeight = -1
;   ExtLine1Linetype = "ByLayer"
;   ExtLine1Point = (367365.0 198795.0 0.0)
;   ExtLine1Suppress = 0
;   ExtLine2Linetype = "ByLayer"
;   ExtLine2Point = (367365.0 198901.0 0.0)
;   ExtLine2Suppress = 0
;   ExtLineFixedLen = 75.0
;   ExtLineFixedLenSuppress = 0
;   Fit = 3
;   ForceLineInside = 0
;   FractionFormat = 0
;   Handle (RO) = "21123E"
;   HasExtensionDictionary (RO) = 0
;   HorizontalTextPosition = 0
;   Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 000002d3fbc984b8>
;   Layer = "Dimension"
;   LinearScaleFactor = 1.0
;   Linetype = "ByLayer"
;   LinetypeScale = 1.0
;   Lineweight = -2
;   Material = "ByLayer"
;   Measurement (RO) = 106.0
;   Normal = (0.0 0.0 1.0)
;   ObjectID (RO) = 78
;   ObjectName (RO) = "AcDbAlignedDimension"
;   OwnerID (RO) = 75
;   PlotStyleName = "Color_4"
;   PrimaryUnitsPrecision = 2
;   Rotation = 0.0
;   RoundDistance = 0.0
;   ScaleFactor = 1.0
;   StyleName = "tashfa-99"
;   SubUnitsFactor = 100.0
;   SubUnitsSuffix = ""
;   SuppressLeadingZeros = -1
;   SuppressTrailingZeros = -1
;   SuppressZeroFeet = -1
;   SuppressZeroInches = -1
;   TextColor = 256
;   TextFill = 0
;   TextFillColor = 0
;   TextGap = 0.09
;   TextHeight = 35.0
;   TextInside = -1
;   TextInsideAlign = 0
;   TextMovement = 0
;   TextOutsideAlign = -1
;   TextOverride = ""
;   TextPosition = (367292.0 198848.0 0.0)
;   TextPrefix = ""
;   TextRotation = 0.0
;   TextStyle = "ARIAL"
;   TextSuffix = ""
;   ToleranceDisplay = 0
;   ToleranceHeightScale = 1.0
;   ToleranceJustification = 1
;   ToleranceLowerLimit = 0.0
;   TolerancePrecision = 0
;   ToleranceSuppressLeadingZeros = 0
;   ToleranceSuppressTrailingZeros = 0
;   ToleranceSuppressZeroFeet = -1
;   ToleranceSuppressZeroInches = -1
;   ToleranceUpperLimit = 0.0
;   TrueColor = #<VLA-OBJECT IAcadAcCmColor 000002d3fbc95990>
;   UnitsFormat = 2
;   VerticalTextPosition = 0
;   Visible = -1

 

Edited by RepCad
Link to comment
Share on other sites

@RepCad  as expressed at the vlax-dump 

 

Quote

Measurement (RO) = 106.0

It is Read Only. 

 

you have to use TEXTOVERRIDE property 

 

(SETQ DIM (CAR (ENTSEL)))

(SETQ DIM-OB (VLAX-ENAME->VLA-OBJECT DIM))



(VLA-PUT-TEXTOVERRIDE DIM-OB 15); just to change

(VLA-PUT-TEXTOVERRIDE DIM-OB "<>  15" ) ;show the real measurement and new override 



 

 

Edited by devitg
add code
  • Like 2
Link to comment
Share on other sites

Don't make this a habit @RepCad and have a note on the drawing maybe on defpoints so at least if someone comes back to edit the drawing they know some dimensions have text override.

 

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...