Kubotek Forum

KeyCreator & KeyCreator Viewer Technical discussion of CAD/CAM and integrated partner products
Subscribe to post
User avatar
Dana - (11/5/2021 9:40:13 AM)
RE:KXL: editing a note?
Thanks Hans, that works!

I looked at teaching myself C++ so I could write CDEs a few years back (back in the "gadget utilities" days), got a shrink wrapped copy from a friend whose son worked at Microsoft.  Looked at the first few code examples and decided I had better things to do with my time. 

FWIW, this started because I wanted to link two notes (using the new |401 note field) in a drawing border together so I only have to change one and the other changes automatically.  I tried doing it in the border file, but when it's imported the entity IDs change, so I have to edit the target note after the border file is inserted, and I wanted to make that easier.

------------------------------------------------------------------------------------------

// changes the target note entity to be linked to the text of the sourceID
// requires Hans Winkler's GetVarToKXL64.cde
// DMH 211105

:start
clear hsource, hEntNote, sourceID, $NoteToCDE
MASKENTITY 9, 10, 11, 12, 13, 14, 15, 16
:select
GETENT "Select detail entity with target text:", hsource
ON (@key+3) GOTO done, done,
GETENT "Select detail entity to match to target:", hEntNote
on (@key+3) GOTO done, select,
MASKCLEAR
GetIDFromEnt hsource, sourceID
SPrint $sNoteToCDE, "|401%i|401", sourceID
CDEOpen "GetVarToKXL64.cde"
CDEExecute "ModNoteText"
CallFunc (0xA1CA)
NoteState
GOTO start
:done
clear hsource, hEntNote, sourceID, $NoteToCDE

Login