Jump to content

Summing multiple dimensions (actual dimension entities)


Recommended Posts

How can I sum up the actual dimension enties. I would like to check a row of dimensions to make sure they add up.

 

Sometimes the dimensions can be off a hundreth in a long line of dimensioning.

Link to comment
Share on other sites

Thank you. I wanted to be able to sum the dimension entities withoout changing the precision. I would like to be able to add the dimension entities at the present precision because that is what will be used to construct.

 

I also used Ctrl+8 to bring up the calculator but I don't understand how this can add dimension entities other than "by hand". Am I missing something. Thank you as well.

Link to comment
Share on other sites

I dont believe there is any stock autocad command that will do what you want. One could make a lisp rountine Im sure, If there isnt one already out there.

 

Im still a little mystifyed about what it its exaclty that you are trying to achieve. If you just want to know the total distance across something you could just use the distance command?

 

:unsure:

Link to comment
Share on other sites

We have strings of 10 to 15 or more dimensions that have an overall dimension above them. We have to have the decimal places set to two for the drawing. We need a quick way to check to see if the dimensions add up to the overall dimension. At present, we have to add all of the dimensions with a calculator to make sure they add up to the overall dimension.

 

I am very surprised that I cannot find a lisp routine or a built in feature in Autocad that will sum the values of dimension entities.

 

I would like to be able to select two or more dimensions and obtain the sum.

 

I can check the overall dimension with the distance command but I need to know that a row of dimensions, each with two decimal places ,will add up to the overall dimension.

 

I am very surprised that I cannot find a solution to what seemed to me at first to be a simple problem.

Link to comment
Share on other sites

Well the only thing i can think of is try using the Quickcalc command. You can do a distance and it will input the value into the calculator, then you can add and select distance again...wash rinse repeat. Its a bit clunky and might not be any better than doing it by hand with a calculator but you will at least get the measured values as they stand inside of autocad.

Link to comment
Share on other sites

Thanks, it is amazing that I have been checking these dimensions by hand all of this time and when I finally think of a way to simplify the process, a lisp of this simple routine cannot be found. I have searched everywhere. What is also incredible is that if there is not a lisp routine out there to do this, everone is still checking their dirmensions by hand also. We have been checking them by hand for so long, we did not imagine being able to simplify the process.

 

I know that the lisp routine would be simple because all you would have to do is to select the dimension, obtain it's value and so on and then sum all the values.

 

I searched the net pretty hard and I am in shock that this simple tool cannot be found.

 

Thank you and thanks to everybody that posted.

Link to comment
Share on other sites

Thanks, it is amazing that I have been checking these dimensions by hand all of this time and when I finally think of a way to simplify the process, a lisp of this simple routine cannot be found. I have searched everywhere. What is also incredible is that if there is not a lisp routine out there to do this, everone is still checking their dirmensions by hand also. We have been checking them by hand for so long, we did not imagine being able to simplify the process.

 

I know that the lisp routine would be simple because all you would have to do is to select the dimension, obtain it's value and so on and then sum all the values.

 

I searched the net pretty hard and I am in shock that this simple tool cannot be found.

 

Thank you and thanks to everybody that posted.

 

 

 

Well, hope I helped.

 

Im still puzzled as to why you need to check and sum individual dims if you are showing an overall dim. I mean as long as the overall is what you want, and you are drawing every thing accuratly why do you need to go back and check your dims individually?

Link to comment
Share on other sites

The site plan is drawn by the architect and is sometimes off a hundreth here and there. But no matter what, as a checker, I will always check dimensions on a site plan to make sure they add up. I cannot know if the drawing is off (drawn incorrectly) until I check the dimension and they do not add up.

 

 

I tried to write the lisp but I cannot figure how to select the multiple dimensions and get the values nor do I know how to sum them once I have them in the lisp routine.

 

The lisp site is very much appreciated though.

Link to comment
Share on other sites

This is an interesting concept so I put together a quick VBA routine to check it’s viability. The routine could certainly use more work, especially to include Fractional and Architectural units. Another day, perhaps.

 

 
Option Explicit

Sub CompDisplay2Actual()
Dim intCode(6) As Integer
Dim varData(6) As Variant
Dim entEntity As AcadEntity
Dim dblCurrentMeasure As Double
Dim dblRunningMeasure As Double
Dim dblCurrentDisplay As Double
Dim dblRunningDisplay As Double
Dim dblRoundedMeasure As Double
Dim entRotated As AcadDimRotated
Dim entAligned As AcadDimAligned
Dim intPrecision As Integer
Dim intAppPrecision As Integer
  intAppPrecision = ThisDrawing.GetVariable("LUPREC")
  intCode(0) = 0: varData(0) = "Dimension"
  intCode(1) = -4: varData(1) = "<Or"
     intCode(2) = 70: varData(2) = 32
     intCode(3) = 70: varData(3) = 33
     intCode(4) = 70: varData(4) = 160
     intCode(5) = 70: varData(5) = 161
  intCode(6) = -4: varData(6) = "Or>"
  If SoSSS(intCode, varData) > 0 Then
  For Each entEntity In ThisDrawing.SelectionSets.Item("TempSSet")
     Select Case entEntity.ObjectName
     Case "AcDbRotatedDimension"
        Set entRotated = entEntity
        dblCurrentMeasure = entRotated.Measurement
        intPrecision = entRotated.PrimaryUnitsPrecision
        dblCurrentDisplay = Round(dblCurrentMeasure, intPrecision)
     Case "AcDbAlignedDimension"
        Set entAligned = entEntity
        dblCurrentMeasure = entAligned.Measurement
        intPrecision = entAligned.PrimaryUnitsPrecision
        dblCurrentDisplay = Round(dblCurrentMeasure, intPrecision)
     End Select
     dblRunningMeasure = dblRunningMeasure + dblCurrentMeasure
     dblRunningDisplay = dblRunningDisplay + dblCurrentDisplay
  Next
  dblRoundedMeasure = Round(dblRunningMeasure, intAppPrecision)
  MsgBox "Total measure as displayed: " & dblRunningDisplay & _
  vbCr & "Total as returned by 'Distance': " & dblRoundedMeasure & _
  vbCr & "Total actual measure: " & dblRunningMeasure

  End If
End Sub


Sub SSClear()
Dim SSS As AcadSelectionSets
  On Error Resume Next
  Set SSS = ThisDrawing.SelectionSets
     If SSS.Count > 0 Then
        SSS.Item("TempSSet").Delete
     End If
End Sub
Function SoSSS(Optional grpCode As Variant, Optional dataVal As Variant) As Integer
  Dim TempObjSS As AcadSelectionSet
  SSClear
  Set TempObjSS = ThisDrawing.SelectionSets.Add("TempSSet")
        'pick selection set
  If IsMissing(grpCode) Then
     TempObjSS.SelectOnScreen
  Else
     TempObjSS.SelectOnScreen grpCode, dataVal
  End If
  SoSSS = TempObjSS.Count
End Function

 

I guess the other question would be; what should be done if there is a significant discrepancy? Which of the two dimensions takes precedence, and which should be modified? Is this another reason to only provide one explicit dimension set, even if it means a final dimension needs to be derived by some poor SOB on site? o:)

Link to comment
Share on other sites

Incredible. How did you do this? Amazing. Do you work for NASA?

 

You have a gift for code. I cannot thank you enough. Next time I am in Rhode Island, I would like to buy you a beer.

 

I very much appreciate your help. It's people like you that make this industry great.

Link to comment
Share on other sites

  • 6 years later...

I think the logic of a VisualLISP program to add the displayed dimensions would go something like the following.

1. Prompt user to select a group of linear dimension lines.

2. Determine the number of dims selected (call it n)

3. Create a loop of n iterations and for each dim do the following:

a. Extract the dimstyle using assoc 3 of the selected dim

b. Make that dimstyle current.

c. Retrieve the precision of the dimstyle with: (setq prec (getvar “dimdec”))

d. Get the precise dimension value using assoc 42

e. Round the true dimension value to the displayed value using a combination of real-to-string and ASCII-to-floating point. E.g.:

(setq dimround (atof (rtos dimtrue prec prec)))

f. Use a summer to add the selected dims: (setq sum (+ sum dimround))

 

I don’t have time to code this right now but this should get you started. You may want to include the ability to subtract a dimension as well. Good luck!

Link to comment
Share on other sites

I think the logic of a VisualLISP program to add the displayed dimensions would go something like the following.

1. Prompt user to select a group of linear dimension lines.

2. Determine the number of dims selected (call it n)

3. Create a loop of n iterations and for each dim do the following:

a. Extract the dimstyle using assoc 3 of the selected dim

b. Make that dimstyle current.

c. Retrieve the precision of the dimstyle with: (setq prec (getvar “dimdec”))

d. Get the precise dimension value using assoc 42

e. Round the true dimension value to the displayed value using a combination of real-to-string and ASCII-to-floating point. E.g.:

(setq dimround (atof (rtos dimtrue prec prec)))

f. Use a summer to add the selected dims: (setq sum (+ sum dimround))

 

I don’t have time to code this right now but this should get you started. You may want to include the ability to subtract a dimension as well. Good luck!

 

I don't know about lisp...please see below detail

 

dimension shows 22 27/32" but decimal shows 22.83333. not show original 22.84375 its various. how to i find this error.or how rectify this error. and i sum this 5 intermediate is 22 27/32", its comes error 1/32" or 1/16". how to find fractional shows like this 22.8333. any lisp for actual fractional dimension calculation, or any lisp for highlight error fractional dimension in autocad................... kindly help..

Link to comment
Share on other sites

As I understand it, the length being dimensioned is 22.8333 but since you have the dim style set to Fractional and the precision set to 1/32” the displayed dimension line shows 22 27/32. The easiest fix may be to modify the geometry so that the distance truly is 22.84375. If this is not practical then a lisp program would be helpful to convert the fraction part of the displayed text and compare it with the decimal component of the true dimension and output the difference. Any volunteers to write this code? I don’t think it would be hard just tedious. I don't have the time now to do it.

Link to comment
Share on other sites

Have you tried using the dimension ordinate command. Set your ucs to the base point you wish to use, then use the dimension ordinate command to provide you a running total as it were from the base point.

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...