Jump to content

Changing Precision


Recommended Posts

I know how to set the precision of angle dimensions on a global basis (Units). But I have a doc with dozens of angle and linear dimensions and builder now wants just degrees instead of degrees/minutes. Is there a better way than clicking one at a time? The selection commands don't distinguish be/t angle and linear dimensions, so can't use that. And can't see where to change precision via scripting. Any ideas?

Link to comment

This took an hour more than it should have due to incorrect documentation and odd program behavior.

The following script will set the precision for each angular dimension on the active layer as you wish. It falls short in its inability to update the dimension text on screen. I leave this as an exercise to the curious, or NNA's engineering staff.

There is a fairly easy work around if all the DIM's are at the top level of the layer. After the script is run, all the angular dimensions are selected. Toggle one of the check boxes in the OIP (i.e. - Show Dim Value) and the screen will update. If your dimensions are inside groups, you will have to enter each group and toggle the OIP, sorry.

I tried RedrawAll, moving the text and moving it back, turning it off and then on again, and a few other things I already forget. Without manually moving the text, or toggling an OIP switch, the DIM text does not reflect the VS change.

Regarding the documentation, you must read Dimension ObjectVariable 20 as an integer (as documented), but it must be written as a LongInt. Do not read it as a LongInt, or you'll get garbage. It's workable, but confusing.

Good night, and good luck,

Raymond

code:

procedure SetDimDisplay;	

{Author : R. Mullin; Date : 25 September 2003 }

{ Sets the dimension precision for each angular DIM on the }

{ active layer and leaves all the angular DIM's selected. }

CONST

Precision = 1; { 1 = D, 2 = DM, 3 = DMS, 5 = 0.0, 6 = 0.00, 7 = 0.000, 8 = 0.0000 }

function SetDimPrecision(H:Handle):Boolean;

Begin

if (GetType(H)=63) and (GetObjectVariableInt(H, 26)=5) then begin { 5 = Angular Dim }

SetObjectVariableLongInt(H, 20, Precision); { 20 = Primary DIM Precision }

SetSelect(H); { will leave dimension selected for manual update }

end;

End; { SetDimPrecision }

BEGIN

DSelectAll;

ForEachObjectInLayer(SetDimPrecision, 1, 2, 0); { All objs, Deep, Active layer }

SysBeep;

END;

Run(SetDimDisplay);
[/code]

Link to comment

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