News:

Please remember to do a search before you ask a question!

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.

PPM Script: Scale as Parameter

Started by Alvin Gregorio, December 15, 2021, 10:05:21 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Alvin Gregorio

I see in the Help Docs' PPM Scripting "Reserved Words List" "ScaleX", "ScaleY", "ScaleZ".

Does anyone know if these can somehow be used as a Parameter?  And if so, how?

For example:

Units(1[mm]);

Sc=Parameter("Scale",1,LINEAR);
ScX=ScaleX(R,Sc);

R=Rectangle(10,5);
Output(ScX)
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

#1
Have you tried? It is light blue but is doesn't seem to do anything.
A lot of the Time words are reserved for internal functions or for future use. So it is reserved but doesn't work.
some words like Distance should be in the reserved list  - but aren't there.

I usually just add *S - where S is the scale Parameter.

circ = CIRCLE(2*S,0,0)
rec = Rectangle(10*SX,5) // scale X
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Alvin Gregorio

I did try ScaleX, all sorts of different ways.  No success.

I think it's what you said Nikki-- reserved for future use; but they've stopped developing PPM scripting.
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: nikkipollard on December 15, 2021, 08:43:41 PM
...
some words like Distance should be in the reserved list  - but aren't there.
...

My curiosity is piqued.  Itches and needs to be scratched.  What is "Distance" in PPM scripting?  Is it an Identifier?; Function?; Condition?; ...?   And what does it do?

And-- as I am always wondering when I read about discovered terms and operations that are not covered in the TC PPSE Help documentation-- HOW did you discover 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)

nikkipollard

#4
I don't know what the  purpose of "Distance" is Alvin. All I know is you can't use it.
I know because I wrote a custom function, saved as  "Distance.ppm", to measure distance between 2 points in a ppm.
When I tried to use the function it crashed TC. when I renamed it to "Distance1.ppm"  - it worked.
Distance is light blue so I think it should be reserved because it must be used internally.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

John R

Is "Distance" part of "View|Measurement|Distance"; a part of the Measurement Info palette tools?
John R.

V17—V21, 2015—2025
Designer, Deluxe, (Basic, Expert, Professional), Platinum
RedSDK enabled
Windows 11 Pro (25H2), 64-bit

Alvin Gregorio

That must be very frustrating for new TurboCADers.  For me, Measurement Tools are in my Tools Menu; has been for a decade or two.  I believe I am still working from a custom Workspace configuration initially created in version-11, which, of course, started with something installation provided.

It has to be frustrating to newer users when we or the Help docs state a Tool or other command is somewhere, but it's not for them, in their current Workspace configuation.
I was hoping this recently(?) added "Find" feature within Customize would have the ability to bring to the front of Toolbars, Menus, Palettes the result of the "Find", and have it flashing.
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)

John R

This "Distance" tool was the first thing I thought of and ran it through the MacroRecorder and got "View|Measurement|Distance".

Running "Distance" through the Search tool on the Commands page shows a whole lot of 'Distance' commands. While each instance will be highlighted, one has to click on the highlighted command so that the "Currently Available On:" section displays what Menu and/or Toolbar the command is found on. If you don't select the Command, nothing shows below or it will show the previous selected command Menu/Toolbars. PITA.
John R.

V17—V21, 2015—2025
Designer, Deluxe, (Basic, Expert, Professional), Platinum
RedSDK enabled
Windows 11 Pro (25H2), 64-bit

Alvin Gregorio

Quote from: John R on December 18, 2021, 02:11:59 PM
...While each instance will be highlighted, one has to click on the highlighted command so that the "Currently Available On:" section displays what Menu and/or Toolbar the command is found on. If you don't select the Command, nothing shows below or it will show the previous selected command Menu/Toolbars. PITA.

I thought "Cool... they do have something incorporated that will help us find where the command is located in the current Workspace configuration".

But-- in my installation of V2020Platinum;64-bit;Bld_44.4-- the ability you described John does not exist.  I tried left-clicking and right-clicking.  Interestingly-- and probably tellingly-- when I left-click on the highlighted command, a tiny little box pops up and a little X adjacent to and part of it; if I hold down the left-click, the tiny almost-popup and X remain.  (similar cause as my and Gary's issue with the new Workspace name not being listed, I suspect; I'm suspecting User Account Control)
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

That might be why there is a conflict.
A lot of the reserved words are commands in Turbocad.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Alvin Gregorio

Quote from: Alvin Gregorio on December 18, 2021, 03:37:40 PM
Quote from: John R on December 18, 2021, 02:11:59 PM
...While each instance will be highlighted, one has to click on the highlighted command so that the "Currently Available On:" section displays what Menu and/or Toolbar the command is found on. If you don't select the Command, nothing shows below or it will show the previous selected command Menu/Toolbars. PITA.

I thought "Cool... they do have something incorporated that will help us find where the command is located in the current Workspace configuration".

But-- in my installation of V2020Platinum;64-bit;Bld_44.4-- the ability you described John does not exist.  I tried left-clicking and right-clicking.  Interestingly-- and probably tellingly-- when I left-click on the highlighted command, a tiny little box pops up and a little X adjacent to and part of it; if I hold down the left-click, the tiny almost-popup and X remain.  (similar cause as my and Gary's issue with the new Workspace name not being listed, I suspect; I'm suspecting User Account Control)

I tested with my Windows User Account Control "Off".  Did not resolve the issue.
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)

John R

Sorry about that Alvin. I forgot that this feature was new to TurboCAD 2021.
I don't have it in TurboCAD 2020 either.
John R.

V17—V21, 2015—2025
Designer, Deluxe, (Basic, Expert, Professional), Platinum
RedSDK enabled
Windows 11 Pro (25H2), 64-bit

Alvin Gregorio

Quote from: John R on December 19, 2021, 08:23:50 AM
Sorry about that Alvin. I forgot that this feature was new to TurboCAD 2021.
I don't have it in TurboCAD 2020 either.

Hmm... seems like they were developing it for as early as the 2019 release, if not earlier.
Like I say, I get a semblance of it in 2019 Deluxe and 2020 Platinum.
Below is me holding down the left mouse button; 2019 Deluxe.
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 resort to:  If I can't find a command that I've read about here or otherwise previously didn't know about, I drag it up to my self-created "New Tools (to me)" folder.  Even if just for one-time use for that session.
It works; not optimal, but it works.  At least I have the "Find" feature; it was a complete mystery before that.
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)

John R

Do you use the Arrow icons to move through the available commands?
John R.

V17—V21, 2015—2025
Designer, Deluxe, (Basic, Expert, Professional), Platinum
RedSDK enabled
Windows 11 Pro (25H2), 64-bit

Alvin Gregorio

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)