Kubotek Forum

KeyCreator & KeyCreator Viewer Technical discussion of CAD/CAM and integrated partner products
Kubotek Forum > KeyCreator & KeyCreator Viewer > KXL Help View modes: 
User avatar
Valued member
Valued member
ken.lemay@yarema.com - 12/6/2017 2:54:33 PM
   
KXL Help
I have a kxl macro that tells me the size of a solid. I’ve used it for years. With  KC 2017 it now displays the wrong data.
If I create a solid block 1.000 x 2.000 x 3.000 and run the macro I get a size of 1.0025 x 2.0050 x 3.0075. Since I don’t know anything about kxl macros (I got this long ago on the old forum) can you help me?

Here is the code:


//Macro script to find the X,Y,Z Block stock for all geometry in model mode.
//This macro will find the extents in the top and right side view.
//The dimesions are all based from the view coordinates

 


:Start
//Define and clear all variables
 CLEAR PartX, PartY, PartZ
 CLEAR dModx, dModY, dModz
 CLEAR MinCoord, MaxCoord
 DOUBLE MinCoord[3], MaxCoord[3]  
 DOUBLE dModx, dMody, dModz
 PartX = 0
 PartY = 0
 PartZ = 0

:Top
// Model Mode extents of the top view 
 GetModelExtents 1, MinCoord, MaxCoord
 dModX = (MaxCoord[0] - MinCoord[0])
 dModY = (MaxCoord[1] - MinCoord[1])

:Right
// Model Mode extents of the right side view
 GetModelExtents 5, MinCoord, MaxCoord
 dModY = (MaxCoord[0] - MinCoord[0])
 dModZ = (MaxCoord[1] - MinCoord[1])


:Calculate
// calculate the smallest to the largest size to make a logical note
 If ((dModX < dModY)&&(dModX < dModZ))
  PartX = dModX
 If ((dModY < dModX)&&(dModY < dModZ))
  PartX = dModY
 If ((dModZ < dModX)&&(dModZ < dModY))
  PartX = dModZ
 If ((dModX > dModY)&&(dModX > dModZ))
  PartZ = dModX
 If ((dModY > dModX)&&(dModY > dModZ))
  PartZ = dModY
 If ((dModZ > dModX)&&(dModZ > dModY))
  PartZ = dModZ
 If ((dModX > PartX)&&(dModX < PartZ))
  PartY = dModX
 If ((dModY > PartX)&&(dModY < PartZ))
  PartY = dModY
 If ((dModZ > PartX)&&(dModZ < PartZ))
  PartY = dModZ

:MessageBox
 string $csText
 Sprint $csText, "Block Stock size is\n%.4f X %.4f X %.4f",PartX, PartY, PartZ
 MessageBox $csText, 0

:Done
 Maskclear
 Exit




Thanks
Ken
Ken Lemay
Yarema Die and Engineering
Troy, Mi

User avatar
Advanced member
Advanced member
Hans_Winkler - 12/6/2017 7:32:57 PM
   
RE:KXL Help
Ken,
this is a bug which I have reported. Have not heard anyhting when it is scheduled for fixing. I agree, that is a real bummer.
Hans

User avatar
Valued member
Valued member
ken.lemay@yarema.com - 12/7/2017 7:06:53 AM
   
RE:KXL Help
Hans
Thanks for the reply.
Hey! If this is your original KXL You made I owe you a belated THANKS.
I use it all the time. Hope it gets fixed.
Ken
Ken Lemay
Yarema Die and Engineering
Troy, Mi

User avatar
Advanced member
Advanced member
Hans_Winkler - 12/7/2017 10:55:56 AM
   
RE:KXL Help
Ken,
can't say for sure if I wrote that, wrote way too many KXL's, can't keep track of them anymore :)
Hans

User avatar
Advanced member
Advanced member
Ram - 2/14/2018 8:45:21 AM
   
RE:KXL Help
I have assigned this to the v15.5 development queue and will post an update when available.
Ram Eswaran
CTO & General Manager
Kubotek3D

User avatar
Advanced member
Advanced member
Ram - 2/14/2018 4:14:14 PM
   
RE:KXL Help
Update..We have traced the cause of this issue to our graphics library. We will escalate the same with our component vendor. Unfortunately, this issue will not be addressed in v15.5. We will target this for v16.
Ram Eswaran
CTO & General Manager
Kubotek3D

User avatar
Member
Member
kenh@cardinalmfg.com - 12/11/2017 9:11:43 AM
   
RE:KXL Help
Ken,
I am pretty sure this one is mine.
It is part of a larger BOM program I wrote back for version 4.0.

Kenneth Harris


User avatar
Valued member
Valued member
ken.lemay@yarema.com - 12/12/2017 10:23:13 AM
   
RE:KXL Help
Oops Sorry Ken
I thank you for the use of this kxl. As I posted earlier it saved me a lot of time.
Thanks Again
Ken
Ken Lemay
Yarema Die and Engineering
Troy, Mi

User avatar
Advanced member
Advanced member
Hans_Winkler - 2/6/2018 6:04:05 PM
   
RE:KXL Help
Ken,
add the following code (the three bold lines)
PartX = PartX * (1/1.002513885498047)
PartY = PartY * (1/1.002513885498047)
PartZ = PartZ * (1/1.002513885498047)


right after this line
:MessageBox

That extra code will get you really close to the correct result. If the parts you work with are really large, let's say 100 inches, you may get the following: 99.9999.

This may help you until it gets fixed.

Hans

User avatar
Advanced member
Advanced member
Hankwt - 2/7/2018 7:13:36 AM
   
RE:KXL Help
Im new to this world of KXL    I have recorded macros and bound them to hot keys  ...........  however how does one enter this type of written macro ??

1 2
Login