News:

All posts discussing pricing or where to buy TurboCAD will be deleted.

Main Menu
TurboCAD 2026 Platinum box
Now available

TurboCAD 2026.2

The latest update for TurboCAD 2026. It installs over any 2026 build and keeps your activation, drawings and settings. Get it from the Start Page or Help > Check for Update.

Insertion of contrain dimension onto 3D print router guide.

Started by Steve Edwards, March 04, 2026, 01:14:44 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Steve Edwards

A few years ago, I managed to use constraints to model a router insert that, with just five basic inputs into a calculator, would reconfigure a router guide plate to perfectly suit a hinge and door combination. This was necessary because inch and metric hinges differ slightly in size, even from the dimensions stated on the packaging. By measuring with a digital caliper and entering the exact size into my drawing, the plate would be adjusted to fit precisely. The cutter and guide diameters could also be changed. After printing the plate, I'd write on it the hinge size, leaf width, door thickness, cutter diameter, and guide diameter—details unique to each printed plate insert. Recently, I saw someone using Fusion 360 on Makerworld who had the same idea but managed to transfer the five parameters directly onto the plate, eliminating the need to write on it afterward. I'm not sure if this is possible in TC, but I'll ask anyway: is there a way to automatically add the parameter text to the custom printed plates, similar to what the Fusion 360 user did? I've attached my drawing if anyone has suggestions.  
TurboCAD Platinum 2024
NVIDIA RTX 4000
12th Gen Intel(R) Core(TM) i9-12900K   3.20 GHz
Windows 11 Pro (64)
64 GB RAM
Bambu P1S with AMS

murray dickinson

I can't see your file, Steve.  Do you mean having embossed dimensions on the part that update from the value of the constraints?  If so, does it have to be analogue, ie infinitely variable between limits or from a set of quanta?  If quanta, are they to fixed ratios like metric paper sizes, to a defined set of ratios or infinitely variable ratios? 

nikkipollard

#2
I can't see the drawing either.
I doubt you would be able to do it with constraints
But it would be easy to do with a script.
This is just a box but you can script most 3d objects
It looks long but that is because I added comments
//this is a comment
//debossed text example
//set units
Units(1[mm])

//Parameters - properties to change in the Selection info palette

W = Parameter("Width",100,LINEAR)
H = Parameter("Height",300,LINEAR)
D = Parameter("Depth",20,LINEAR)
TS = Parameter("Font","Verdana",FONT)
TH = Parameter("Text Height",10,LINEAR)
TD = Parameter("Text Depth",2,LINEAR)

//Order the parameters in the Selection info palette
Output(W,H,D,TD,TS,TH)

//Profile
prof = Rectangle(W,H)
//Path
path = Polyline(Point(0,0,0),Point(0,0,D))
//3d graphic
Box = Sweep(prof,path)
//set up text
//note I multiplied the height of the text by 0.667 to get the actual height of the text but
//this value depends on the font - it works for verdana
Fnt = TextFont(0,TH*0.667,0,TS)
Fsty = TextStyle(TOP,LEFT)
words = ""+W+"" + "x" + ""+H+""
//write the text
t1 = Text(words, Fnt, Fsty)
//move the text
// the text is 2mm from the top left corner - this might make some font styles not work
t2 = Move(t1,2-W/2,-2+H/2,D-TD)
//change the properties of the text
//("TextMode") = 3 -flexible text
t3 = SetProperties(t2,"TextMode" = 3)
//change the thickness of the text
t4 = Thickness(t3,TH+1)

//BooleanSubtract
eBox = BooleanSubtract(Box,t4)

Output(eBox)


Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

murray dickinson

#3
That's very elegant, Nikki!  I admire and envy your perception and ability with scripting....There's a way that I can see to do it from variables, draw the constrained part with the variable parameters and give the parameters names, set up lines with constrained dimensions on the face of the block or plate or whatever this is, so that the location of those line control the placement of the text.  Use flexible text for the dimensions.  In the variables palette, fill the formula fields for the text placement lines with "=Var1" or whatever name you've given the appropriate parameter, so they're slaves/children of the constraints but can be located conveniently.  When the info you want to emboss or deboss is set, select all those dimensions that you want to show, MakeCopy them and explode them immediately, I mean without deselecting them, then select the multiline text objects, manually or by query.  They have a thickness field now, so you can make 'em however high or sunken and add or subtract them to the plate.  Clumsier than yours, Nikki, but maybe a bit more visible and obvious for some elements like text placement and spread on the part.  There's a couple of manual actions to complete, I wonder how well F360 places the text info on the compontent or if manual intervention is needed there, too?'

Steve Edwards

I'm a bit stuck at moment, seems we have a major breakdown with internet.  Thanks for replies , I'll reply in full when all is fixed. I can re-post drawing in TC 2022 too. 5g only at this time
TurboCAD Platinum 2024
NVIDIA RTX 4000
12th Gen Intel(R) Core(TM) i9-12900K   3.20 GHz
Windows 11 Pro (64)
64 GB RAM
Bambu P1S with AMS

Steve Edwards

We're back up to a full 250MB/sec. Thanks for the replies—Nikki, I appreciate you taking the time to write the script, and I'll give it a try once I wrap my head around it as the "elegant solution." Murray, your "less elegant" approach also deserves some investigation on my part. This time, I've attached the TC Plat 2022 drawing, which should be more accessible. I've also included the Makerworld example showing print on the jig surface that I'd like to replicate, along with an image of a typical router guide setup and a commercially available version.

You cannot view this attachment.
You cannot view this attachment. You cannot view this attachment. You cannot view this attachment. You cannot view this attachment.
TurboCAD Platinum 2024
NVIDIA RTX 4000
12th Gen Intel(R) Core(TM) i9-12900K   3.20 GHz
Windows 11 Pro (64)
64 GB RAM
Bambu P1S with AMS

Steve Edwards

Quote from: murray dickinson on March 04, 2026, 06:47:44 PMI can't see your file, Steve.  Do you mean having embossed dimensions on the part that update from the value of the constraints?  If so, does it have to be analogue, ie infinitely variable between limits or from a set of quanta?  If quanta, are they to fixed ratios like metric paper sizes, to a defined set of ratios or infinitely variable ratios?
If I understand your post. They are variables and currently no limitation on them. However if I specify a hinge length that is too long the constrained drawing fails (it cannot be drawn). Like wise the other input dimensions.
Inlike paper sizes in your example hinges do not seem to follow a set ratio. No doubt there is, or should be, a standard somewhere. My experience is they vary around a standard length and leaf size and often rounded to a nominal size.   
TurboCAD Platinum 2024
NVIDIA RTX 4000
12th Gen Intel(R) Core(TM) i9-12900K   3.20 GHz
Windows 11 Pro (64)
64 GB RAM
Bambu P1S with AMS

murray dickinson

What you're interested in is the information layout on the plate?  Like a sticker format?  Or you want it debossed, imprinted into the guide?  It's tricky to derive the text values automatically from the constraint value and deboss it in the part in pleasing arrangement.  Nikki's cool script or variations on it makes that easy, you can change the text, location and update incrementally to find a satisfying orientation.  Kudos again, Nikki.

nikkipollard

Hi Steve
This would be very easy to script. A nice beginner project.
I still can't open the drawing as I am still using the 2021 version.
I am battling to match the required parameters with the calculator palette.
If you go to options, preferences and constraints you can enable "show variable name in the dimension text"
And retake the screen shot
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

PCSteel

John@PC Steel

Core i7-6700 CPU
16GB Ram
64 Bit
Windows 10 Home
TurboCAD 2015 Pro Platinum 64 bit Build 90.0
TurboCAD 2023 Platinum 64 bit Build 63.3

Steve Edwards

Thanks, John, for the 2021 posting. I can only go back to 2022 from 2024.  

Nikki, I've posted a screenshot showing the variable name in the dimension text (with the drawing tidied up a bit), and another mock-up with 1mm debossed label info displaying the five variables in plain language. If space is too limited, this may need to be split into two blocks of text, but I can address that later.  

I've never used scripts before, so be ready for some naive questions—this is a parametric script as opposed to a Ruby script, right? 

Many Thanks Steve
You cannot view this attachment. You cannot view this attachment.  

TurboCAD Platinum 2024
NVIDIA RTX 4000
12th Gen Intel(R) Core(TM) i9-12900K   3.20 GHz
Windows 11 Pro (64)
64 GB RAM
Bambu P1S with AMS

Steve Edwards

Hi Nikki
I had a go. I found where the .ppm scripts are located, but could not copy your script there because of the premissions. I did however create my own folder and using notepad named and created .ppm (using copy and paste of your posted script) . I then run the file in the Parametric Part Script editor and it inserted a block with debossed text, now shown in red within screenshot. That for me is progress.




You cannot view this attachment.
TurboCAD Platinum 2024
NVIDIA RTX 4000
12th Gen Intel(R) Core(TM) i9-12900K   3.20 GHz
Windows 11 Pro (64)
64 GB RAM
Bambu P1S with AMS

Alvin Gregorio

#12
Hi Steve.

When you initially posted, were you requiring for the text to be added automatically, the verbiage being variable corresponding to the Variable and its corresponding Value?
or
Were you willing to settle for manually inputting the Text and its verbiage?
__________
Are you committed to using Constraints?  Or are you willing to completely change the method to using PPM?
PPM is way more robust.  And therefore in this case, better.
_________
If we're abandoning your years-old-utilized method of Constraints, what is it that you are hanging up with now in using Nikki's PPM script?  I just inserted Nikki's script. I see that it's nowhere near the full "Hinge Pocket Router Jig" that you have in mind.  Now that Nikki has your .tcw file, I'm sure it won't take her long to complete and perfect the script— for the full parametric jig, including the parametric text.
  Nikki-- Since Steve has a multi-filament printer, it be best to have the Text that is the subtrahend to not be deleted.  And be a separate object.  So that the Text would be 3D Printed a different color than the jig body; and to mitigate issues with the 3D Printing of the fine detail of debossed text.
__________
Steve— I agree with Nikki that this is an excellent learning exercise of writing PPM scripts.  I thought you had already spent some time learning the basics of PPM scripting; but I might be remembering incorrectly.
  If you are wanting to learn PPM scripting, remember to not use the documentation in the Offline or Online User Guide— too poorly formatted to clearly follow along.  Use my formatted version of it instead, pinned at the top of the PPM Forum board.  Remember to use 2-page view in your PDF reader; and experiment with the "Show Cover Page..." setting in the PDF reader so that the odd page numbers are on the right side.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

nikkipollard

This works but it seems the Boolean operation with the text takes a few seconds. _ because of all the curves you might want to simplify it or live with an extra 1 or 2 seconds.
This should be a learning exercised so I have used all the same variable names you used so that it is easy to follow along. I also used your calculations.

//Hinge cut jig

Units(1[mm])

//Parameters
CD = Parameter("Router Diameter",6,LINEAR);
GD = Parameter("Router Guide",16,LINEAR);
DT = Parameter("Door Thickness",23,LINEAR);
HL = Parameter("Hinge Length",76.2,LINEAR);
HW = Parameter("Hinge Width",22,LINEAR);
DD =  Parameter("Text Depth",1,LINEAR);
TTH = Parameter("Text Height",3,LINEAR);
Wo = Parameter("Outer Width",145.6,LINEAR);
Ho = Parameter("Outer Height",113,LINEAR); //was var12
TH = Parameter("Thickness",5,LINEAR)
F = Parameter("Fixed Width",20,LINEAR);
ch = Parameter("Chamfer",5,LINEAR);  //was var14 and var15

Output(CD,GD,DT,HL,HW,TH,TTH,DD,Wo,Ho,F,ch)

//Calculations
off = (DT-HW)-((GD-CD)/2)
aw = HW + GD + 10
al = HL+GD-CD
//cn = -(Wo-al)/2  see edge calc
//var15 = GD-1.5 not sure what this was for
edge = (Wo-al)/2

//outer shape
oprof = Polyline(Point(0,0),
                Point(0,Ho),
                Point(Wo,Ho),
                Point(Wo,ch),
                Point(Wo-ch,0),
                Point(0,0))
 oprof1 = Thickness(oprof,TH) 

//hole
//Rectangle(x length,y length,x centre, y centre)
hol1 = Rectangle(al,aw,al/2+edge,-aw/2+Ho-F-off)
hole = Thickness(hol1,TH)

Jig1 = BooleanSubtract(oprof1,hole)

//Text
//set up the font
Fnt = TextFont(0,TTH*1.64,0,"Verdana")
//set up the style
Fsty = TextStyle(TOP,CENTER,BOLD)

words1 = "Hinge length = " + HL + "  Door thickness = " + DT
words2 = "Hinge width (leaf) = " + HW
words3 = "Cutter Diameter = " + CD + "  Guide Diameter = " + GD
//draw the text
//line 1
t1 = Text(words1, Fnt, Fsty)
t1a = Move(t1,Wo/2,Ho-F-aw-TTH-4-off,TH-DD)
//textmode = 3 is flexible text
t1b = SetProperties(t1a,"TextMode" = 3,"Thickness" = DD+1)
//line2
t2 = Text(words2, Fnt, Fsty)
t2a = Move(t2,Wo/2,Ho-F-aw-TTH*2-8-off,TH-DD)
t2b = SetProperties(t2a,"TextMode" = 3,"Thickness" = DD+1)
//line3
t3 = Text(words3, Fnt, Fsty)
t3a = Move(t3,Wo/2,Ho-F-aw-TTH*3-12-off,TH-DD)
t3b = SetProperties(t3a,"TextMode" = 3,"Thickness" = DD+1)

//deboss the text
Jig = BooleanSubtract(Jig1,t1b,t2b,t3b)

//Reference point

Refp = RefPoint(0,0,0)
Output(Refp,Jig)


This is not Ruby or the macro recorder, it is a parametric symbol - works like a dynamic block in autocad.
Drag it in from the library, or edit it in the parametric part editor palette and run from there.
Once it is in the drawing you can change parameters in the Selection info palette.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Steve Edwards

TThanks Nikki, I'll give it a try.  

Alvin, my goal is to have the text added automatically.  

With the benefit of hindsight, starting again with PPM seems like the better option. I initially used this project to understand constraints, but I can just as easily use it to teach myself PPM.  

I agree—subtracting but leaving it there means the text can be flush with the surface and easily printed in a different color.  

I may have experimented with PPM scripts in the past, but I relied on the online documentation (which, in hindsight, was a big mistake). I have your document now, which is so much clearer, and I'll work through it in the coming days.  
TurboCAD Platinum 2024
NVIDIA RTX 4000
12th Gen Intel(R) Core(TM) i9-12900K   3.20 GHz
Windows 11 Pro (64)
64 GB RAM
Bambu P1S with AMS

Dean

Steve,
or you could take the easy road... :)

Export your jig from TC in 3mf format.
Open in 3D Builder and deboss text, save as 3mf open in Bambu.
3D builder is a free windows app, a lot of fun...
"What do I know, I'm still learning".
Lenovo Legion T5  Intel(R) Core(TM) i7-14th Gen 20 cores Nvidia RTX 4070 Super 16GB Windows 11 home TurboCad 2025 with Animation Lab 6.0

Steve Edwards

Just tried your new script Nikki, it worked without any issues. I honestlty do not know how you can write a script that quickly and without any errors, fanstastic. It printed without issue too.

I used to write routines for a Sepro pick and place robot attached to an injection moulding machine Boolean logic applied to various inputs, and although the codeing is dfferent I can see the patterns in the logic. 
Inspired by your work and Alvins guide I'm now going to tweak your code a little by adding limits to the hinge length and width variables ( can see already how to do this) and if I can work it out, a piece of code that limits the maximum size of the guide bush and cutter combination. ( the cutter must never be larger than the bush) 
Cd =< Gd - 4 and =>4. (must be equal or bigger than 4 but never greater than the Guide bush minus 4)
Gd => 10 and =< 20. ( must be equal or bigger than 10 and equal or less than 20)

Thanks Steve
You cannot view this attachment.
TurboCAD Platinum 2024
NVIDIA RTX 4000
12th Gen Intel(R) Core(TM) i9-12900K   3.20 GHz
Windows 11 Pro (64)
64 GB RAM
Bambu P1S with AMS

Steve Edwards

#17
Hi Dean, Not sure whether you use Bambu studio, but one can add text in the same manner you describe and shown in image, and I might add on cylindrical and conical parts (clever stuff) My aim in this case however is to try and add it automatically direct from the variable inputs. The script method looks like it will do the job.
I shall log you suggestion to use 3D Builder though.
Thanks Steve
You cannot view this attachment.
TurboCAD Platinum 2024
NVIDIA RTX 4000
12th Gen Intel(R) Core(TM) i9-12900K   3.20 GHz
Windows 11 Pro (64)
64 GB RAM
Bambu P1S with AMS

Alvin Gregorio

#18
This leaves a copy of the text in the deboss-ment.
There's probably a more elegant way of scripting this, with less verbiage, but it seems to work.
After insertion and adjusting the Parameters, I think one might have to Explode it once before Saving as a .step, .stl, .obj, or .3mf, for 3D Printing.

This might still need some work.  I'm out of time now.

//File Name= Hinge Pocket Router Jig -003.ppm //Alvin added
//Hinge cut jig
//Alvin Edit to leave a Copy of the Text lines in place //Alvin added

Units(1[mm])

//Parameters
CD = Parameter("Router Diameter",6,LINEAR);
GD = Parameter("Router Guide",16,LINEAR);
DT = Parameter("Door Thickness",23,LINEAR);
HL = Parameter("Hinge Length",76.2,LINEAR);
HW = Parameter("Hinge Width",22,LINEAR);
DD =  Parameter("Text Depth",1,LINEAR);
TTH = Parameter("Text Height",3,LINEAR);
Wo = Parameter("Outer Width",145.6,LINEAR);
Ho = Parameter("Outer Height",113,LINEAR); //was var12
TH = Parameter("Thickness",5,LINEAR)
F = Parameter("Fixed Width",20,LINEAR);
ch = Parameter("Chamfer",5,LINEAR);  //was var14 and var15

Output(CD,GD,DT,HL,HW,TH,TTH,DD,Wo,Ho,F,ch)

//Calculations
off = (DT-HW)-((GD-CD)/2)
aw = HW + GD + 10
al = HL+GD-CD
//cn = -(Wo-al)/2  see edge calc
//var15 = GD-1.5 not sure what this was for
edge = (Wo-al)/2

//outer shape
oprof = Polyline(Point(0,0),
                Point(0,Ho),
                Point(Wo,Ho),
                Point(Wo,ch),
                Point(Wo-ch,0),
                Point(0,0))
 oprof1 = Thickness(oprof,TH)

//hole
//Rectangle(x length,y length,x centre, y centre)
hol1 = Rectangle(al,aw,al/2+edge,-aw/2+Ho-F-off)
hole = Thickness(hol1,TH)

Jig1 = BooleanSubtract(oprof1,hole)

//Text
//set up the font
Fnt = TextFont(0,TTH*1.64,0,"Verdana")
//set up the style
Fsty = TextStyle(TOP,CENTER,BOLD)

words1 = "Hinge length = " + HL + "  Door thickness = " + DT
words2 = "Hinge width (leaf) = " + HW
words3 = "Cutter Diameter = " + CD + "  Guide Diameter = " + GD
//draw the text
//line 1
t1 = Text(words1, Fnt, Fsty)
t1a = Move(t1,Wo/2,Ho-F-aw-TTH-4-off,TH-DD)
//textmode = 3 is flexible text
t1b = SetProperties(t1a,"TextMode" = 3,"Thickness" = DD+1)
t1c = Move(t1a,0,0,0,1);//Alvin added
t1d = SetProperties(t1c,"TextMode" = 3,"Thickness" = DD, "PenColor" = 0xFF);//Alvin added
//line2
t2 = Text(words2, Fnt, Fsty)
t2a = Move(t2,Wo/2,Ho-F-aw-TTH*2-8-off,TH-DD)
t2b = SetProperties(t2a,"TextMode" = 3,"Thickness" = DD+1)
t2c = Move(t2a,0,0,0,1);//Alvin added
t2d = SetProperties(t2c,"TextMode" = 3,"Thickness" = DD, "PenColor" = 0x00FF00);//Alvin added
//line3
t3 = Text(words3, Fnt, Fsty)
t3a = Move(t3,Wo/2,Ho-F-aw-TTH*3-12-off,TH-DD)
t3b = SetProperties(t3a,"TextMode" = 3,"Thickness" = DD+1)
t3c = Move(t3a,0,0,0,1);//Alvin added
t3d = SetProperties(t3c,"TextMode" = 3,"Thickness" = DD, "PenColor" = 0xFF0000);//Alvin added

//deboss the text
Jig = BooleanSubtract(Jig1,t1b,t2b,t3b)

//Reference point

Refp = RefPoint(0,0,0)
Output(Refp,Jig)
Output(t1d,t2d,t3d)//Alvin added
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

nikkipollard

#19
Hi Steve,

To Limit Parameters within a range use Interval

W = Parameter("Width",100,LINEAR,Interval(20,150))

You can't control one parameter with another, I usually use an IF statement, which works similarly to an
excel If statement x = IF(Logical test, value if true, value if false)

A1 = Parameter("Parameter A ",100,LINEAR,max(400))
B = Parameter("Parameter B ",80,LINEAR)

A = IF(A1<B,B,A1)
//Parameter A will never be Greater than 400 and Less than Parameter B

Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

nikkipollard

Quote from: Alvin Gregorio on March 06, 2026, 03:13:23 PMThis leaves a copy of the text in the deboss-ment.
There's probably a more elegant way of scripting this, with less verbiage, but it seems to work.
After insertion and adjusting the Parameters, I think one might have to Explode it once before Saving as a .step, .stl, .obj, or .3mf, for 3D Printing.

This might still need some work.  I'm out of time now.

//File Name= Hinge Pocket Router Jig -003.ppm //Alvin added
//Hinge cut jig
//Alvin Edit to leave a Copy of the Text lines in place //Alvin added

Units(1[mm])

//Parameters
CD = Parameter("Router Diameter",6,LINEAR);
GD = Parameter("Router Guide",16,LINEAR);
DT = Parameter("Door Thickness",23,LINEAR);
HL = Parameter("Hinge Length",76.2,LINEAR);
HW = Parameter("Hinge Width",22,LINEAR);
DD =  Parameter("Text Depth",1,LINEAR);
TTH = Parameter("Text Height",3,LINEAR);
Wo = Parameter("Outer Width",145.6,LINEAR);
Ho = Parameter("Outer Height",113,LINEAR); //was var12
TH = Parameter("Thickness",5,LINEAR)
F = Parameter("Fixed Width",20,LINEAR);
ch = Parameter("Chamfer",5,LINEAR);  //was var14 and var15

Output(CD,GD,DT,HL,HW,TH,TTH,DD,Wo,Ho,F,ch)

//Calculations
off = (DT-HW)-((GD-CD)/2)
aw = HW + GD + 10
al = HL+GD-CD
//cn = -(Wo-al)/2  see edge calc
//var15 = GD-1.5 not sure what this was for
edge = (Wo-al)/2

//outer shape
oprof = Polyline(Point(0,0),
                Point(0,Ho),
                Point(Wo,Ho),
                Point(Wo,ch),
                Point(Wo-ch,0),
                Point(0,0))
 oprof1 = Thickness(oprof,TH)

//hole
//Rectangle(x length,y length,x centre, y centre)
hol1 = Rectangle(al,aw,al/2+edge,-aw/2+Ho-F-off)
hole = Thickness(hol1,TH)

Jig1 = BooleanSubtract(oprof1,hole)

//Text
//set up the font
Fnt = TextFont(0,TTH*1.64,0,"Verdana")
//set up the style
Fsty = TextStyle(TOP,CENTER,BOLD)

words1 = "Hinge length = " + HL + "  Door thickness = " + DT
words2 = "Hinge width (leaf) = " + HW
words3 = "Cutter Diameter = " + CD + "  Guide Diameter = " + GD
//draw the text
//line 1
t1 = Text(words1, Fnt, Fsty)
t1a = Move(t1,Wo/2,Ho-F-aw-TTH-4-off,TH-DD)
//textmode = 3 is flexible text
t1b = SetProperties(t1a,"TextMode" = 3,"Thickness" = DD+1)
t1c = Move(t1a,0,0,0,1);//Alvin added
t1d = SetProperties(t1c,"TextMode" = 3,"Thickness" = DD, "PenColor" = 0xFF);//Alvin added
//line2
t2 = Text(words2, Fnt, Fsty)
t2a = Move(t2,Wo/2,Ho-F-aw-TTH*2-8-off,TH-DD)
t2b = SetProperties(t2a,"TextMode" = 3,"Thickness" = DD+1)
t2c = Move(t2a,0,0,0,1);//Alvin added
t2d = SetProperties(t2c,"TextMode" = 3,"Thickness" = DD, "PenColor" = 0x00FF00);//Alvin added
//line3
t3 = Text(words3, Fnt, Fsty)
t3a = Move(t3,Wo/2,Ho-F-aw-TTH*3-12-off,TH-DD)
t3b = SetProperties(t3a,"TextMode" = 3,"Thickness" = DD+1)
t3c = Move(t3a,0,0,0,1);//Alvin added
t3d = SetProperties(t3c,"TextMode" = 3,"Thickness" = DD, "PenColor" = 0xFF0000);//Alvin added

//deboss the text
Jig = BooleanSubtract(Jig1,t1b,t2b,t3b)

//Reference point

Refp = RefPoint(0,0,0)
Output(Refp,Jig)
Output(t1d,t2d,t3d)//Alvin added


That works but you don't need to set the properties of the text again, just add the color property to t1b,t3b and t2b
and include them in the final Output
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Steve Edwards

Nikki and Alvin thanks for your time. With all the help you have given I shall be fine. I need to study for myself now.
It has opened a whole new world for me and I look forward to learning something new.
Have a good day.
Steve
TurboCAD Platinum 2024
NVIDIA RTX 4000
12th Gen Intel(R) Core(TM) i9-12900K   3.20 GHz
Windows 11 Pro (64)
64 GB RAM
Bambu P1S with AMS

Alvin Gregorio

Quote from: nikkipollard on March 06, 2026, 09:31:49 PMThat works but you don't need to set the properties of the text again, just add the color property to t1b,t3b and t2b
and include them in the final Output
Thanks Nikki.
I do need to set the Thickness of the copy Text again, as I want the top of the text that is to remain in the deboss-ment to be flush with the top of the plate— since you have the subtrahend Text thickness at DD+1, so to ensure there is not a co-planar (co-facet) issue after the Boolean Subtraction.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

Quote from: Steve Edwards on March 06, 2026, 10:54:44 PMI need to study for myself now.
It has opened a whole new world for me and I look forward to learning something new.
  Goodbye, for a while, Steve.  PPM scripting can be addictive.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Dean

Quote from: Steve Edwards on March 06, 2026, 12:39:16 PMHi Dean, Not sure whether you use Bambu studio, but one can add text in the same manner you describe and shown in image, and I might add on cylindrical and conical parts (clever stuff) My aim in this case however is to try and add it automatically direct from the variable inputs. The script method looks like it will do the job.
I shall log you suggestion to use 3D Builder though.
Thanks Steve


Hi Steve, yes I know about Bambu.
3D builder has Planar, cylindrical and spherical text,
It's just a different and simple environment to work in :)
Having text debossing automatic using TC constraints is cool though, hope it works out for you.
"What do I know, I'm still learning".
Lenovo Legion T5  Intel(R) Core(TM) i7-14th Gen 20 cores Nvidia RTX 4070 Super 16GB Windows 11 home TurboCad 2025 with Animation Lab 6.0

Steve Edwards

Dean, that is pretty neat! I have only used 3D builder for repairing models and that works very well too.

Alvin, your modified code workd fine and I did not have to explode the text to get it to print. I need to study your Guide so that I can write script for myself, I'm not going away just need to get the grey matter working. I managed to colour change the text by changing the hex colour code, and nothing crashed ! so that is progress by my measure.
I'm going to set size limits ising the Interval command next. Slow but sure as they say.
I'm enjoying the challenge, I suppose that helps.
TurboCAD Platinum 2024
NVIDIA RTX 4000
12th Gen Intel(R) Core(TM) i9-12900K   3.20 GHz
Windows 11 Pro (64)
64 GB RAM
Bambu P1S with AMS

Alvin Gregorio

#26
Nikki, please remind me— How do we get Parameters organized in categories/sections in the Selection Info palette?

I found my answer— To place a parameter under a specific heading, use the format: "GroupName\ParameterLabel"
//Parameters
CD = Parameter("Router\Router Diameter",6,LINEAR);
GD = Parameter("Router\Router Guide",16,LINEAR);
DT = Parameter("Door\Door Thickness",23,LINEAR);
HL = Parameter("Hinge\Hinge Length",76.2,LINEAR);
HW = Parameter("Hinge\Hinge Width",22,LINEAR);
DD =  Parameter("Text\Text Depth",1,LINEAR);
TTH = Parameter("Text\Text Height",3,LINEAR);
Wo = Parameter("Jig\Outer Width",145.6,LINEAR);
Ho = Parameter("Jig\Outer Height",113,LINEAR); //was var12
TH = Parameter("Jig\Thickness",5,LINEAR)
F = Parameter("Jig\Fixed Width",20,LINEAR);
ch = Parameter("Jig\Chamfer",5,LINEAR);  //was var14 and var15
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

murray dickinson

Anybody given any thought to an adjustable jig that you can slip a router bit and hinge into, slap onto the edge of a door, tighten up and use in the moment?

PCSteel

I've been using a pencil, chisel and hammer for 55 years. It's fast and quiet.  ;D
John@PC Steel

Core i7-6700 CPU
16GB Ram
64 Bit
Windows 10 Home
TurboCAD 2015 Pro Platinum 64 bit Build 90.0
TurboCAD 2023 Platinum 64 bit Build 63.3


Steve Edwards

What is a chisel and hammer? Must be some ancient tool.

In fairness I don't fit many doors these days not in my home anyway,only in my sons or daughters places. They definitely would not know one end of chisel from the other.

My brother borrowed my router jig about a year ago, he was fitting 12 new doors in his home, 2 hinges on each.




TurboCAD Platinum 2024
NVIDIA RTX 4000
12th Gen Intel(R) Core(TM) i9-12900K   3.20 GHz
Windows 11 Pro (64)
64 GB RAM
Bambu P1S with AMS

Steve Edwards

The Mark2 PPM version now includes modifications to other components, making it easier to use. I tested it on an old scaffold plank since I don't have a door. Unfortunately, the wood was a bit damp after sitting outside all winter, but it still managed to rebate, though not with the cleanest cut.  

Next, I plan to tweak the script to add size limits and prevent cutter and guide clashes. This has been great fun and a rather surprising discovery for me.
TurboCAD Platinum 2024
NVIDIA RTX 4000
12th Gen Intel(R) Core(TM) i9-12900K   3.20 GHz
Windows 11 Pro (64)
64 GB RAM
Bambu P1S with AMS

Alvin Gregorio

Quote from: Steve Edwards on March 08, 2026, 09:30:00 AMThe Mark2 PPM version
Are you ready yet to share that iteration script with us, Steve?

I was wondering how this jig adhered to the door. I now see.  Is that larger apparatus home-designed/made?  Or did you purchase it?
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Steve Edwards

This dosn't work. I not sure why not.
1) I added the Interval values to the HW and HL (to ensure the printed intert guide is practical for printing)
2) I changed the pencolor all three lines to 000000 (hex Black)
3)Added 4 If conditions following the format in a number of examples that I came across 
4)Added comment notes // at positions where I made changes.

I think I have messed up
You cannot view this attachment.

And thats another thing, how does one publish to the forum in ascrolling window, as you and Nikki did

TurboCAD Platinum 2024
NVIDIA RTX 4000
12th Gen Intel(R) Core(TM) i9-12900K   3.20 GHz
Windows 11 Pro (64)
64 GB RAM
Bambu P1S with AMS

Alvin Gregorio

Quote from: Steve Edwards on March 08, 2026, 12:22:32 PMAnd thats another thing, how does one publish to the forum in ascrolling window, as you and Nikki did
You cannot view this attachment.

What's beneficial about sharing Code this way— Not only is it easy to Copy/Paste into PPSE, when they have the next Great Purge and delete all attachments, it might preserve (need to verify).
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

#35
Quote from: Steve Edwards on March 08, 2026, 12:22:32 PMsn't work. I not sure why not.
In Notepad++, I am using the Compare Plug-in to compare my ...-003.ppm versus your ...080326.txt script

I haven't fixed it, but some things for you to scrutinize:
>Line 13 - GD Parameter - Is missing a ) at the end
>Line 15 - HL Parameter - Is missing "Interval" and a ( and ) for those values (I assume Interval is intended with the 47,102)
>Line 16 - HW Parameter - same as above for Line 15
>Lines 36-38 - These three IF lines don't have conditions
>Line 36-37 - The first two IF functions both start with the identifier Gd

>I believe the Color Hex Code starts with 0x.  As in for Blue it would be 0xFF0000 (can be truncated to 0xFF)*.  So for Black it would be 0x000000

Every character or missing character matters.  As you know, from your scripting experience.

*
My understanding is that TurboCAD's PPSE uses BGR color code not RGB; so it's inverse of typical Hex Code.  But I could use some education on Color Properties in TC PPM scripts.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

#36
Try this.  It works.  But not with your IF conditions, because they have the syntax errors I described in my just-previous post.
All the still-in-place Text is Black.  From your 000000 entry, I assumed that's what you wanted.  But if you want just Black, I'd just omit the "PenColor" Property.

//File Name= Steves PPM version 080326 -AlvinEdit-01.txt //Alvin added
//Hinge cut jig
//Alvin Edit to leave a Copy of the Text lines in place //Alvin added
// Steve has added size limit on HL and HW 080326
// Steve has changed TH default from 5 to 8
// Steve has changed CD default from 6 to 8 (to suit IF Calculation)
// Steve has Changed GD default from 16 to 15 for same reason as above

Units(1[mm])

//Parameters
CD = Parameter("Router Diameter",8,LINEAR,Interval(4,16));
GD = Parameter("Router Guide",15,LINEAR,Interval(10,20));  //Alvin added a ) at the end
DT = Parameter("Door Thickness",23,LINEAR);
HL = Parameter("Hinge Length",76.2,LINEAR,Interval(47,102));  //Alvin added- Interval(  ,and a ) at the end
HW = Parameter("Hinge Width",22,LINEAR,Interval(12,35));  //Alvin added- Interval(  ,and a ) at the end
DD =  Parameter("Text Depth",1,LINEAR);
TTH = Parameter("Text Height",3,LINEAR);
Wo = Parameter("Outer Width",145.6,LINEAR);
Ho = Parameter("Outer Height",113,LINEAR); //was var12
TH = Parameter("Thickness",8,LINEAR)
F = Parameter("Fixed Width",20,LINEAR);
ch = Parameter("Chamfer",5,LINEAR);  //was var14 and var15

Output(CD,GD,DT,HL,HW,TH,TTH,DD,Wo,Ho,F,ch)

//Calculations
// Steve has added two if calculations to limit CD cutter size in relation to the guide bush
off = (DT-HW)-((GD-CD)/2)
aw = HW + GD + 10
al = HL+GD-CD
//cn = -(Wo-al)/2  see edge calc
//var15 = GD-1.5 not sure what this was for
edge = (Wo-al)/2
// This is steves IFs
///Gd=IF(<10,10) //Alvin commented out this line; it is missing a Condition
///Gd=IF(>20,20) //Alvin commented out this line; it is missing a Condition; and it has the same Name as the IF line above
///Cd=IF(< 4,4) //Alvin commented out this line; it is missing a Condition
///Cd=IF(> Gd-4,Cd=Gd-4)  //Alvin commented out this line; it is calling out the errorneous IF functions above

//outer shape
oprof = Polyline(Point(0,0),
                Point(0,Ho),
                Point(Wo,Ho),
                Point(Wo,ch),
                Point(Wo-ch,0),
                Point(0,0))
 oprof1 = Thickness(oprof,TH)

//hole
//Rectangle(x length,y length,x centre, y centre)
hol1 = Rectangle(al,aw,al/2+edge,-aw/2+Ho-F-off)
hole = Thickness(hol1,TH)

Jig1 = BooleanSubtract(oprof1,hole)

//Text
//set up the font
Fnt = TextFont(0,TTH*1.64,0,"Verdana")
//set up the style
Fsty = TextStyle(TOP,CENTER,BOLD)

words1 = "Hinge length = " + HL + "  Door thickness = " + DT
words2 = "Hinge width (leaf) = " + HW
words3 = "Cutter Diameter = " + CD + "  Guide Diameter = " + GD
//draw the text
//line 1
t1 = Text(words1, Fnt, Fsty)
t1a = Move(t1,Wo/2,Ho-F-aw-TTH-4-off,TH-DD)
//textmode = 3 is flexible text
t1b = SetProperties(t1a,"TextMode" = 3,"Thickness" = DD+1)
t1c = Move(t1a,0,0,0,1);//Alvin added
t1d = SetProperties(t1c,"TextMode" = 3,"Thickness" = DD, "PenColor" = 0x000000);//Alvin added//Steve amended // Alvin added 0x
//line2
t2 = Text(words2, Fnt, Fsty)
t2a = Move(t2,Wo/2,Ho-F-aw-TTH*2-8-off,TH-DD)
t2b = SetProperties(t2a,"TextMode" = 3,"Thickness" = DD+1)
t2c = Move(t2a,0,0,0,1);//Alvin added
t2d = SetProperties(t2c,"TextMode" = 3,"Thickness" = DD, "PenColor" = 0x000000);//Alvin added//Steve Amended // Alvin added 0x
//line3
t3 = Text(words3, Fnt, Fsty)
t3a = Move(t3,Wo/2,Ho-F-aw-TTH*3-12-off,TH-DD)
t3b = SetProperties(t3a,"TextMode" = 3,"Thickness" = DD+1)
t3c = Move(t3a,0,0,0,1);//Alvin added
t3d = SetProperties(t3c,"TextMode" = 3,"Thickness" = DD, "PenColor" = 0x000000);//Alvin added//Steve amended // Alvin added 0x

//deboss the text
Jig = BooleanSubtract(Jig1,t1b,t2b,t3b)

//Reference point

Refp = RefPoint(0,0,0)
Output(Refp,Jig)
Output(t1d,t2d,t3d)//Alvin added

I don't know what you are after with your IF conditions.  But if you tell us that, maybe we can help you get those right.
Can tell us in words for each of your four intended IF lines:  "If [this] occurs, then [this]; if not, then [this]",
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Steve Edwards

I clearly had not checked thoroughly before posting. I had conflicting information from my research, one said use the word interval the other just said enter two values separated by commas

I sent you a mixture of both..

The IF statements should say GD and CD respectively ( not Gd and Cd)
I got the IF statement format from one of Tim's examples for a rectangle.

In plain English it was meant to convey:-
If Cutter Dia is greater than the Guide Dia minus 4 the Cutter Dia to be the Guide Dia minus 4 otherwise Cutter Dia equal Cutter Dia ( ie leave it alone, don't change it) clearly the syntax or logic is incorrect.

I'll take another look tomorrow along with your reply script 

Steve
TurboCAD Platinum 2024
NVIDIA RTX 4000
12th Gen Intel(R) Core(TM) i9-12900K   3.20 GHz
Windows 11 Pro (64)
64 GB RAM
Bambu P1S with AMS

Alvin Gregorio

Quote from: Steve Edwards on March 08, 2026, 02:33:47 PMI had conflicting information from my research, one said use the word interval the other just said enter two values separated by commas
See Page-16 of my formatted PDF of the TC User Guide's PPM Scripting (numbered Page-7).  It clearly describes it.
You cannot view this attachment.

Note: The Table Of Contents in that PDF are all hyperlinked to pages.  And/or you can use the reader app's Find feature.  (but I'd start in the Table Of Contents, which are Pages 6 & 7 of the PDF, it lists everything)
 
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

#39
Quote from: Steve Edwards on March 08, 2026, 02:33:47 PMIn plain English it was meant to convey:-
If Cutter Dia is greater than the Guide Dia minus 4 the Cutter Dia to be the Guide Dia minus 4 otherwise Cutter Dia equal Cutter Dia ( ie leave it alone, don't change it) clearly the syntax or logic is incorrect.
Maybe this; it seems to work for me as described:
//File Name= Steves PPM version 080326 -AlvinEdit-03.txt //Alvin added
//Hinge cut jig
//Alvin Edit to leave a Copy of the Text lines in place //Alvin added
// Steve has added size limit on HL and HW 080326
// Steve has changed TH default from 5 to 8
// Steve has changed CD default from 6 to 8 (to suit IF Calculation)
// Steve has Changed GD default from 16 to 15 for same reason as above

Units(1[mm])

//Parameters
CD = Parameter("Router Diameter",8,LINEAR,Interval(4,16));
GD = Parameter("Router Guide",15,LINEAR,Interval(10,20));  //Alvin added a ) at the end
DT = Parameter("Door Thickness",23,LINEAR);
HL = Parameter("Hinge Length",76.2,LINEAR,Interval(47,102));  //Alvin added- Interval(  ,and a ) at the end
HW = Parameter("Hinge Width",22,LINEAR,Interval(12,35));  //Alvin added- Interval(  ,and a ) at the end
DD =  Parameter("Text Depth",1,LINEAR);
TTH = Parameter("Text Height",3,LINEAR);
Wo = Parameter("Outer Width",145.6,LINEAR);
Ho = Parameter("Outer Height",113,LINEAR); //was var12
TH = Parameter("Thickness",8,LINEAR)
F = Parameter("Fixed Width",20,LINEAR);
ch = Parameter("Chamfer",5,LINEAR);  //was var14 and var15

Output(CD,GD,DT,HL,HW,TH,TTH,DD,Wo,Ho,F,ch)

//Calculations
// Steve has added two if calculations to limit CD cutter size in relation to the guide bush
off = (DT-HW)-((GD-CDIF)/2)
aw = HW + GD + 10
al = HL+GD-CDIF
//cn = -(Wo-al)/2  see edge calc
//var15 = GD-1.5 not sure what this was for
edge = (Wo-al)/2
// This is steves IFs
///Gd=IF(<10,10) //Alvin commented out this line; it is missing a Condition
///Gd=IF(>20,20) //Alvin commented out this line; it is missing a Condition; and it has the same Name as the IF line above
///Cd=IF(< 4,4) //Alvin commented out this line; it is missing a Condition
///Cd=IF(> Gd-4,Cd=Gd-4)  //Alvin commented out this line; it is calling out the errorneous IF functions above

//below are Alvin's versions of Steve's desired IF functions
CDnull=CD
CDIF=IF(CD>GD-4,GD-4,CDnull);

//outer shape
oprof = Polyline(Point(0,0),
                Point(0,Ho),
                Point(Wo,Ho),
                Point(Wo,ch),
                Point(Wo-ch,0),
                Point(0,0))
 oprof1 = Thickness(oprof,TH)

//hole
//Rectangle(x length,y length,x centre, y centre)
hol1 = Rectangle(al,aw,al/2+edge,-aw/2+Ho-F-off)
hole = Thickness(hol1,TH)

Jig1 = BooleanSubtract(oprof1,hole)

//Text
//set up the font
Fnt = TextFont(0,TTH*1.64,0,"Verdana")
//set up the style
Fsty = TextStyle(TOP,CENTER,BOLD)

words1 = "Hinge length = " + HL + "  Door thickness = " + DT
words2 = "Hinge width (leaf) = " + HW
words3 = "Cutter Diameter = " + CDIF + "  Guide Diameter = " + GD
//draw the text
//line 1
t1 = Text(words1, Fnt, Fsty)
t1a = Move(t1,Wo/2,Ho-F-aw-TTH-4-off,TH-DD)
//textmode = 3 is flexible text
t1b = SetProperties(t1a,"TextMode" = 3,"Thickness" = DD+1)
t1c = Move(t1a,0,0,0,1);//Alvin added
t1d = SetProperties(t1c,"TextMode" = 3,"Thickness" = DD, "PenColor" = 0x0000FF);//Alvin added//Steve amended // Alvin added 0x
//line2
t2 = Text(words2, Fnt, Fsty)
t2a = Move(t2,Wo/2,Ho-F-aw-TTH*2-8-off,TH-DD)
t2b = SetProperties(t2a,"TextMode" = 3,"Thickness" = DD+1)
t2c = Move(t2a,0,0,0,1);//Alvin added
t2d = SetProperties(t2c,"TextMode" = 3,"Thickness" = DD, "PenColor" = 0x00FF00);//Alvin added//Steve Amended // Alvin added 0x
//line3
t3 = Text(words3, Fnt, Fsty)
t3a = Move(t3,Wo/2,Ho-F-aw-TTH*3-12-off,TH-DD)
t3b = SetProperties(t3a,"TextMode" = 3,"Thickness" = DD+1)
t3c = Move(t3a,0,0,0,1);//Alvin added
t3d = SetProperties(t3c,"TextMode" = 3,"Thickness" = DD, "PenColor" = 0xFF0000);//Alvin added//Steve amended // Alvin added 0x

//deboss the text
Jig = BooleanSubtract(Jig1,t1b,t2b,t3b)

//Reference point

Refp = RefPoint(0,0,0)
Output(Refp,Jig)
Output(t1d,t2d,t3d)//Alvin added

Maybe we ought to change that IF condition to "if Cutter Diameter is greater than or equal to Guide Diameter minus 4".  I think >= works; User Guide says it is "not less than", which I think is the same as "greater than or equal to".
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

I think we should rename Parameters so that they match the terminology we use in interaction here and what is printed on the plate.  To mitigate confusion.
Example: We seem to prefer "Cutter Diameter" and "Guide Diameter".  Rename CD and GD Parameters "Cutter Diameter" and "Guide Diameter", respectively.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

#41
What is?:  F = Parameter("Fixed Width"
What is?:  aw
What is?:  al
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

I cleaned it up and organized it and made some of the verbiage a bit more intuitive to work with (for me— my inner-voice)

//File Name= Hinge_Pocket Router_Jig -001.ppm

Units(1[mm])

//Parameters
OW = Parameter("Plate\Outer Width",145.6,LINEAR);
OH = Parameter("Plate\Outer Height",113,LINEAR);
CH = Parameter("Plate\Chamfer",5,LINEAR);
FO = Parameter("Plate\Fixed Offset",20,LINEAR);
DT = Parameter("Door and Hinge\Door Thickness",23,LINEAR);
HW = Parameter("Door and Hinge\Hinge Width",76.2,LINEAR,Interval(47,102));
HH = Parameter("Door and Hinge\Hinge Height",22,LINEAR,Interval(12,35));
CD = Parameter("Router\Cutter Diameter",8,LINEAR,Interval(4,16));
CGD = Parameter("Router\Cutter Guide Diameter",15,LINEAR,Interval(10,20));
TH = Parameter("Text\Text Height",3,LINEAR);
Tthk = Parameter("Text\Thickness",8,LINEAR);
TD = Parameter("Text\Text Depth",1,LINEAR);

Output(OW,OH,CH,FO,DT,HW,HH,CD,CGD,TH,Tthk,TD)

//Calculations
off = (DT-HH)-((CGD-CDIF)/2)
aw = HH + CGD + 10
al = HW+CGD-CDIF
edge = (OW-al)/2

//IF condition so that Cutter Diameter does not exceed feasibility for Cutter Guide Diameter
CDnull=CD
CDIF=IF(CD>=CGD-4,CGD-4,CDnull);

//<<Plate>>
  //outer shape
oprof = Polyline(Point(0,0),
                Point(0,OH),
                Point(OW,OH),
                Point(OW,CH),
                Point(OW-CH,0),
                Point(0,0))
 oprof1 = Thickness(oprof,Tthk)
  //rectangular opening in plate
    //Rectangle(x length,y length,x centre, y centre)
hol1 = Rectangle(al,aw,al/2+edge,-aw/2+OH-FO-off)
hole = Thickness(hol1,Tthk)

Jig1 = BooleanSubtract(oprof1,hole)

//<<Text>>
  //set up the font
Fnt = TextFont(0,TH*1.64,0,"Verdana")
  //set up the style
Fsty = TextStyle(TOP,CENTER,BOLD)

words1 = "Door Thickness = " + DT
words2 = "Hinge Width = " + HW + "  -  Hinge Height = " + HH
words3 = "Cutter Diameter = " + CDIF + "  Cutter Guide Diameter = " + CGD
  //draw the text
  //line 1
t1 = Text(words1, Fnt, Fsty)
t1a = Move(t1,OW/2,OH-FO-aw-TH-4-off,Tthk-TD)
  //(textmode = 3 is flexible text)
t1b = SetProperties(t1a,"TextMode" = 3,"Thickness" = TD, "PenColor" = 0x0000FF) //Text Color is Red
t1c = Move(t1b,0,0,0,1); //Leave the text subtrahend in the deboss
  //line2
t2 = Text(words2, Fnt, Fsty)
t2a = Move(t2,OW/2,OH-FO-aw-TH*2-8-off,Tthk-TD)
t2b = SetProperties(t2a,"TextMode" = 3,"Thickness" = TD, "PenColor" = 0x00FF00); //Text Color is Green
t2c = Move(t2b,0,0,0,1);//Leave the text subtrahend in the deboss
  //line3
t3 = Text(words3, Fnt, Fsty)
t3a = Move(t3,OW/2,OH-FO-aw-TH*3-12-off,Tthk-TD)
t3b = SetProperties(t3a,"TextMode" = 3,"Thickness" = TD, "PenColor" = 0xFF0000); //Text Color is Blue
t3c = Move(t3b,0,0,0,1);//Leave the text subtrahend in the deboss

//deboss the text
Jig = BooleanSubtract(Jig1,t1b,t2b,t3b)

//Reference point

Refp = RefPoint(0,0,0)
Output(Refp,Jig)
Output(t1c,t2c,t3c)
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Steve Edwards

That is really good Alvin. Everything covered including the cutter guide bush possible conflict and the CGD size limits. I see you created CDnull=CD for the IF "test" I can see the format now and it makes sense.

I have downloaded Notepad++ and added the TCppm.xml files that Nikki created (from the PPM section of forum). Hopefully this will assist me in writing scripts along with your guide which I have printed-off paying attention to page 7 in particular. 
TurboCAD Platinum 2024
NVIDIA RTX 4000
12th Gen Intel(R) Core(TM) i9-12900K   3.20 GHz
Windows 11 Pro (64)
64 GB RAM
Bambu P1S with AMS

PCSteel

John@PC Steel

Core i7-6700 CPU
16GB Ram
64 Bit
Windows 10 Home
TurboCAD 2015 Pro Platinum 64 bit Build 90.0
TurboCAD 2023 Platinum 64 bit Build 63.3

Steve Edwards

What have I learnt so far.
Interval does more than set the range of a parameter it acts as an IF condition. If one sets a value in the Selection Info. pallet between the Interval values it is accepted, if outside the lower limit the lower Interval limit is adopted. Conversly if out side the top limit the the top Interval limit is adopted. Knowing this avoids introducing an If condition.

Colour (color) values are RGB Hex values and in TC PPM must be identified with a 0X

An IF condition test has very specific format, a user defined varaible my need to be created for the syntax to be correct. as in CDnull=CD.
Also the parameter being tested must form part of the IF formula as per CDIF=IF(CD>=CGD-4,-4,CDnull);
If Cutter Dia. is greater than or equl to the Cutter Guide Dia. minus 4 then change it to the Cutter Guide Dia minis 4 otherwise make it the size CDnull (which is the Cutter Size being tested.
One need to adopt >= rther than =>.

Some of it is going in!
TurboCAD Platinum 2024
NVIDIA RTX 4000
12th Gen Intel(R) Core(TM) i9-12900K   3.20 GHz
Windows 11 Pro (64)
64 GB RAM
Bambu P1S with AMS

Alvin Gregorio

#46
Quote from: Steve Edwards on March 09, 2026, 01:26:03 PMKnowing this avoids introducing an If condition.
But not an IF condition that is relative to another Parameter's set value.

Quote from: Steve Edwards on March 09, 2026, 01:26:03 PMColour (color) values are RGB Hex values and in TC PPM
I'm thinking it is BGR in TurboCAD's PPM.  Not RGB

Quote from: Steve Edwards on March 09, 2026, 01:26:03 PMColour (color) values are RGB Hex values and in TC PPM must be identified with a 0X
We can also use Integer Color Code instead.  Such as 16711680 for Blue.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

Quote from: PCSteel on March 09, 2026, 12:57:44 PMNeat work Alvin!
Thanks John.  Nikki did all the heavy lifting.  I just tidied it up a bit.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

PCSteel

Yeah, she's clever. I sometimes wish I could do this stuff.
John@PC Steel

Core i7-6700 CPU
16GB Ram
64 Bit
Windows 10 Home
TurboCAD 2015 Pro Platinum 64 bit Build 90.0
TurboCAD 2023 Platinum 64 bit Build 63.3

nikkipollard

Quote from: Alvin Gregorio on March 09, 2026, 02:45:03 PM
Quote from: Steve Edwards on March 09, 2026, 01:26:03 PMKnowing this avoids introducing an If condition.
But not an IF condition that is relative to another Parameter's set value.

Quote from: Steve Edwards on March 09, 2026, 01:26:03 PMColour (color) values are RGB Hex values and in TC PPM
I'm thinking it is BGR in TurboCAD's PPM.  Not RGB

Quote from: Steve Edwards on March 09, 2026, 01:26:03 PMColour (color) values are RGB Hex values and in TC PPM must be identified with a 0X
We can also use Integer Color Code instead.  Such as 16711680 for Blue.
Quote from: Alvin Gregorio on March 09, 2026, 02:45:03 PM
Quote from: Steve Edwards on March 09, 2026, 01:26:03 PMKnowing this avoids introducing an If condition.
But not an IF condition that is relative to another Parameter's set value.

Quote from: Steve Edwards on March 09, 2026, 01:26:03 PMColour (color) values are RGB Hex values and in TC PPM
I'm thinking it is BGR in TurboCAD's PPM.  Not RGB

Quote from: Steve Edwards on March 09, 2026, 01:26:03 PMColour (color) values are RGB Hex values and in TC PPM must be identified with a 0X
We can also use Integer Color Code instead.  Such as 16711680 for Blue.
I use RGB values - they are easy to work out for me .
You can use a COLOR type Parameter if you don't want to do the math.

I am not that clever I just persevered with figuring this stuff out. I am lazy so anything that is repetitive and can't be done with the standard tools gets a script of some sort.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h