Kubotek Forum

KeyCreator & KeyCreator Viewer Technical discussion of CAD/CAM and integrated partner products
Kubotek Forum > KeyCreator & KeyCreator Viewer > note fields View modes: 
User avatar
Advanced member
Advanced member
Dana - 9/21/2021 11:07:54 AM
   
note fields

Is there any documentation for how to use the various fields in a note?  The help file isn't much use.

Some are easy, some can be figured out, and some are incomprehensible.  For example, |012 is "file name without extension", and that works fine.  Others are noted "(delimiter)", and you seem to need to use them twice, e.g. "file last saved at |109|109", but they only work if there's another field after it, what if you don't need any further fields?

Then there are "file properties", "part properties" and "entity part properties""entity file properties"... what are the "entity" ones?  If I try to use "entity part last saved at" (|411) it just gives me #ERR.

 


User avatar
Advanced member
Advanced member
jmccullough@kubotek3d.com - 9/23/2021 1:29:44 PM
   
RE:note fields
Good question Dana. We'll take a look. At a minimum we can add additional explanation to the Field Notes topic in Help. 

Hopefully someone else here can comment from experience using these codes. 

John Wright McCullough
GM Marketing, Kubotek3D

User avatar
Valued member
Valued member
wkrol@kubotek3d.com - 9/24/2021 1:16:17 PM
   
RE:note fields
Dana,

Tale a look at in \KeyCreatorPro.2021.SP2\Lang\English at the BOMAutolabel.dat  
Create a Solid Block. 
GENERIC EDIT solid & add Standard Props (see image)
Use Tools>  BOM and Table> Label Reference Select the soli; arrow pos & label location.

Hope this helps.
-Wes
Post attachments:

User avatar
Advanced member
Advanced member
Soli - 9/25/2021 8:54:38 AM
   
RE:note fields
 
I'm curently work with standart parameters.
First I have to fill the Standart properties and the User properties for each solid entity.
I run a macro to fill those parameters and other macro if I need to edit them.
After, I run a macro GetEntity to get the solid entity ID 
 
If I want to create a note in the drawing I use this:
Where 20 after first Delimiter |402 |403 |404 ... is solid entity ID
For User properties the Delimiter is |413 followed by solid entity ID 20, a comma, name of User property and again |413 
=================================
Part Number = |40220|402 
Part Description = |40320|403 
Part Created By = |40420|404
Part Keywords = |40520|405 
Part Last Saved By = |40620|406 
Part Revision = |40720|407 
Part Material = |40820|408 
Part Vendor = |40920|409
Part Created Date = |41020|410 
Part Last Saved = |41120|411 
Part Comment = |41220|412  
 
TREATMENT = |41320,T TREAT|413
COATING = |41320,COAT|413
WEIGHT = |41320,WEIGHT|413
===================================
The problem is, if I change the solid Properties, this note doesn't update.
 
The solution is, to create a note with this macro:
================================
clear hEnt
HENTITY hEnt
 
int nSelFlag = 0
Int  nSelParent = 1
Int  bSelRefEnts = 0
Int  bAccept = 1
bActiveInstFlag = 1
MASKENTITY 32 
 
GetEnt "Select the component to get Label", hEnt,  , nSelFlag, nSelParent, bSelRefEnts,  , bAccept, bActiveInstFlag 
if (@key == -3)
goto end
 
MASKCLEAR
MASKMAINTAIN 0
 
clear nEntID
Int nEntID 
GetIDFromEnt hEnt , nEntID 
 
CLEAR adTextAtt
DOUBLE adTextAtt[0]
ARRAY adTextAtt[13] = { 0, 5, 0.85, 0.6, 0, 0, 0, 1, 1, 0, 0, 0, 0}
CLEAR anEntAtt
INT anEntAtt[0]
ARRAY anEntAtt[8] = { 3, 0, 1, 1, 1, 0, 0, 0x0 }
 
clear $name
string $name
sprint $name , "NAME = \|403%d\|403" , nEntID
 
clear $quantity 
string $quantity 
// comment : |413 is the field for User Properties and QT'Y is the name of User property
sprint $quantity , "QUANTITY = \|413%d,QT'Y\|413" , nEntID
 
clear $material
string $material
sprint $material , "MATERIAL = \|408%d\|408" , nEntID
 
clear $treatment
string $treatment
sprint $treatment , "T TREAT = \|413%d,T TREAT\|413" , nEntID
 
clear $coating
string $coating
sprint $coating , "COATING = \|413%d,COAT\|413" , nEntID
 
clear $weight
string $weight
sprint $weight , "WEIGHT = \|413%d,WEIGHT\|413 KG" , nEntID
 
clear $note
string $note
sprint $note , "%s\n%s\n%s\n%s\n%s\n%s",  $name ,$quantity , $material , $treatment , $coating , $weight 
 
clear position
DOUBLE position[3]
type_pos=0
 
GETPOS "Select the Note Position", type_pos, position
if (@key == -3)
exit
 
x=position[0]
y=position[1]
z=position[2]
 
worldtocplane x, y, z
NOTE $note , x , y , 0 , , , , 0, "Smooth", adTextAtt, anEntAtt
NoteState
 
CLEAR adTextAtt
DOUBLE adTextAtt[0]
ARRAY adTextAtt[13] = { 0, 8, 0.85, 0.6, 0, 0, 0, 1, 1, 0, 0, 0, 0}
CLEAR anEntAtt
INT anEntAtt[0]
ARRAY anEntAtt[8] = { 1, 0, 1, 1, 1, 0, 0, 0x0 }
 
clear $component_number
string  $component_number
// comment : |100 is the field for file number
sprint $component_number ,"\|100-\|402%d\|402" , nEntID
 
NOTE $component_number,x-10 , y+36 ,0 , , , , 0, "Smooth", adTextAtt, anEntAtt
NoteState
 
:end
MASKCLEAR
MASKMAINTAIN 0
=======================================

 
Solomon Steinberg,
Israel

DELL OPTIPLEX 7050
NVIDIA QUADRO P2000
KEYCREATOR 13.5
KEYCREATOR 2021 SP2



User avatar
Advanced member
Advanced member
Dana - 10/4/2021 4:05:48 PM
   
RE:note fields
Thanks Sol, that helps.  One I still can't figure out is "macro numeric expression".  Seems |0102+2|010 should give me 4, but it doesn't work.

I do wish you could apply user properties to layouts.  I'd like to be able to set the revision of a layout (not the part, as I have multiple layouts in a part) and revision description for each layout.  I can apply those properties to the solid depicted in the layout, but that's more kludgy.

To make the note update, use detail-notes-update fields or "callfunc 0xA1CA" in a macro.

User avatar
Advanced member
Advanced member
Soli - 10/5/2021 12:30:25 PM
   
RE:note fields
Dana,

I didn't find any kxl command to edit the Layout name or Layout description.
I need this, too.

Do you know how to get the actual date?
I found |004 System Time delimiter and the parameters:
Detail>Note>Keyin  |004%A %d-%m-%Y|004   creates a note : Tuesday 05-10-2021
Everything is written in documentation.

But I need to create a kxl string contains the date.

I tried:
===========================
clear $date
string $date
sprint $date , "%s" , "\|004%A %d-%m-%Y\|004"
pause "%s" , $date

note $date , 0 , 0 , 0
notestate
=========================
The $date contains \|004%A %d-%m-%Y\|004
But, the created note is Tuesday 05-10-2021.

I need the string contains the actual date to use it for other purposes.

Can you or Kubotek help?
Thanks


 

Solomon Steinberg,
Israel

DELL OPTIPLEX 7050
NVIDIA QUADRO P2000
KEYCREATOR 13.5
KEYCREATOR 2021 SP2



User avatar
Advanced member
Advanced member
Dana - 10/6/2021 3:55:12 PM
   
RE:note fields
kludgy but it works:


===========================
clear $datestr, $daystr
string $datestr
string $daystr
exec "date /T > c:\\temp\\test.txt"
set devin, "c:\\temp\\test.txt"
input "%s %s", $daystr, $datestr
close devout
exec "del c:\\temp\\test.txt"
pause "%s", $datestr
=========================

User avatar
Advanced member
Advanced member
Soli - 10/7/2021 11:25:51 AM
   
RE:note fields
Dana,

Excellent idea with date /T.
I made a few changes because the command exec "date /T > c:\\temp\\test.txt" doesn't work.
====================================
Set Devout, "d:\\GET_DATE.bat"
print "date /T >d:\\DATE.txt"
CLOSE DEVOUT
exec "d:\\GET_DATE.bat"
SET DEVIN , "d:\\DATE.txt"
clear $date
string $date
INPUT "%s " , $date
CLOSE DEVIN
pause "%s" , $date
====================================

Thank you, Dana
Solomon Steinberg,
Israel

DELL OPTIPLEX 7050
NVIDIA QUADRO P2000
KEYCREATOR 13.5
KEYCREATOR 2021 SP2



User avatar
Advanced member
Advanced member
Dana - 10/8/2021 8:30:22 AM
   
RE:note fields

Yes, the c:\temp folder needs to exist for it to work.

Why the batch file, did it not work without it?  Though sometimes KC is funny about running internal DOS commands like date.  In that case you can try:

exec "cmd /c date /T > c:\\temp\\test.txt"

 


User avatar
Advanced member
Advanced member
Dana - 10/15/2021 7:13:39 AM
   
RE:note fields
Soli wrote: Dana,

I didn't find any kxl command to edit the Layout name or Layout description.
I need this, too.



I used Autoit, a windows scripting language, to change the layout name and do other things not possible with KXL.  This is a snippet of the Autoit code, in this case changing the layout name to the contents of $layname, which is an Autoit variable:

------------------------------------------
        WinActivate("KeyCreator")
        WinWaitActive("KeyCreator")
        Send("{ESC}{ESC}{ESC}{ESC}{F3}{F6}{F1}") ; classic menu detail, layout, control
        WinWait("Drawing Layout Control")
        Sleep(250)
        ControlClick("Drawing Layout Control", "", 1604)
        WinWaitActive("Enter new name for layout")
        ControlSetText("Enter new name for layout", "", 1037, $layname)
        ControlClick("Drawing Layout Control", "", 1)
        WinWaitClose("Enter new name for layout")
        WinWaitClose("Drawing Layout Control")
        Send("{ESC}{ESC}{ESC}{ESC}{ALT}DNP") ; Detail-Note-Update fields
        Sleep(250)
        Send("{ESC}{F6}{F3}{F5}") ; escape to root and autoscale
--------------------------------------------------

1
Login