Kubotek Forum

KeyCreator & KeyCreator Viewer Technical discussion of CAD/CAM and integrated partner products
Subscribe to post
User avatar
Dana - (9/15/2021 3:03:20 PM)
RE:kxl notestate issue
Doh!  You're right, of course... I was going nuts counting those stupid commas.  I cleaned it up quite a bit and now except for some weirdness with the text alignment and leaders which I'm going to ignore, it's working to my satisfaction now.


//AutoDDE hole diameter changer
//DMH 210915-1

:start
MASKCLEAR
MASKENTITY 3  //arcs and circles

// Prompt the user to select an entity
GetEnt "Select arc to modify", hArc, hArci, 0, 0, 1, 0
if (@error != 0)
    GOTO end
MASKCLEAR

INT hundo
NoteState hundo

arcdia = @dbldat[0] * 2
location hcenter, 4,,,,hArc

CLEAR diminfo1
INT diminfo1[40]
diminfo1[0] = 1 // diameter
diminfo1[3] = 2 // auto arrow direction
diminfo1[8] = 46 // "." decimal separator
diminfo1[9] = 1 // text aligned with leader lines
diminfo1[10] = 1 // autocenter text
diminfo1[14] = 1 // trailing zeros
diminfo1[16] = 7 // decimal places
diminfo1[17] = 1 // roundoff
diminfo1[25] = 1 // roundoff for dual dims, doesn't apply but zero is invalid

CLEAR diminfo2
Double diminfo2[11] = {.1,.1,1,1,0,0,0,1,0,0,.1}
double txtatt[13] = {0, arcdia/10, 1, .6, 0, 1, 0, 1, 2, 0, 0, 0, 0}

CIRDIM 2,,hcenter,,,,hArc,,,,0,,,diminfo1, diminfo2,txtatt
CLEAR hDim
HEntity hDim
LastEnt hDim
Redraw

GETDBL "Enter new diameter (%f)", arcdia, newdia
on (@key + 3) goto finish, finish, finish,

CLEAR adPickPt
Double adPickPt[3] = { 0, 0, 0 }
CLEAR aAddFaces
HEntity aAddFaces[0]
CLEAR aRemoveFaces
HEntity aRemoveFaces[0]
DIMENSIONDRIVENEDIT hDim, adPickPt, newdia, aAddFaces, aRemoveFaces

:finish
DelEnt hDim
Redraw
purgeto hundo

GOTO start

:end
MASKCLEAR
Login