Kubotek Forum

KeyCreator & KeyCreator Viewer Technical discussion of CAD/CAM and integrated partner products
Subscribe to post
User avatar
Hans_Winkler - (9/3/2021 12:37:53 PM)
RE:Dimension scaling in model mode
I figured it out via KXL, had one parameter missing!

    DOUBLE dNewScale
    if (dNewScale <= 0)
        dNewScale = .5

    goto GETDIM

:SETNEWSCALE
    GetDbl "Enter new dimension scale factor...ESC or F10 to Quit" , dNewScale, dNewScale
    if (@key == -3)
        EXIT
    if (@key == -2)
        EXIT

    if (dNewScale <=0)
        MessageBox "The scale factor has to be bigger then Zero.\nTry again", 0
    if (dNewScale <=0)
        dNewScale = 1
    if (dNewScale <=0)
        goto SETNEWSCALE

:GETDIM
    HENTITY hEnt
    INT intElement
    MASKENTITY 0, 11, 12, 13, 14, 15, 16, 17
    STRING $sPrompt = ""
    SPRINT $sPrompt, "Select Dimensions (scale set to %f); ESC to Quit; F10 New Scale", dNewScale

    GENSEL $sPrompt, intElement
    if (@key == -3)
        EXIT
    if (@key == -2)
        goto SETNEWSCALE
    

    INT intQuant = 0
    
:ENTITIES
    if ((intQuant = intQuant + 1) > intElement)
         goto DONE

    GETNEXT , hEnt


    GetDetailAttr hEnt, USERSCALE, nUserscale, DIMUNIT, nDimunit
    nUserscale = dNewScale
    nDimunit = 0
    SetDetailAttr hEnt, USERSCALE, nUserscale, DIMUNIT, nDimunit
    RefreshDimension hEnt

    goto ENTITIES

:DONE
    NoteState
Login