News:

Be sure your post is relevant to the current discussion.  Create a new topic within the appropriate board if you are unsure.

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.

Parametric Part Script Editor, Inserting Static Symbols

Started by JeffD, August 31, 2014, 08:04:14 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

JeffD

I am trying to insert a static symbol of a block within a file so just the block appears and not the whole drawing in the script.  However in the manual it gives examples of the file being inserted but not the block option.  Here is my script.

P=StaticSymbol("..\..\..\..\Drawings\4in Luthier Clamp.tcw",CAM);  //This will put the whole drawing in.

P=StaticSymbol("..\..\..\..\Drawings\4in Luthier Clamp.tcw","CAM"); //This will still put the whole drawing in.

P=StaticSymbol("..\..\..\..\Drawings\4in Luthier Clamp.tcw,CAM");  //This will come back with a bad script and insert nothing.

Can Anyone help.  What is missing? I have tried numerous ways and still nothing will produce what the manual says.




   

Torfinn

Hi JeffD

There is not to many people inside here that work with ppm's   :(
Most of them like to work with PP and constraint, kind of wysiwug thing i guess, but ppm is much more funny :)
Tested like the manual say and like you i dont get the result i belived i should get.

Then i noticed that the manuel tell something about that after Drawings, TC will go 1 step more to the Macro folder.
So tested that, make a drawing that only have 1 object and saved in the Macro folder as *.tcw, changed a bit on the script and voila, function :)
Since i dont want to have all this drawing/ symbol's in my Drawing or Macro folder i made 1 more folder and just give it the name Macro2 ( for the test ), move my symbol *.tcw to that folder, changed again in the script and find out that it dosn't matter in what folder i put the *.tcw symbol, its 1 level down from Drawing folder anyway, that meaning TC will find it and put out the symbol.

TC dont need the .tcw in like "4in Luthier Clamp.tcw", only need it if it's not a tcw file, but in the next level, like in "CAM" it need to bee CAM.tcw or something to function.

When inserted in to a drawing it will be a symbol, explode 1 time and it will become a Block, it will not be possible to explode that Block anymore, but the nice thing then was, after explode i can use Selection Info palette to switch between all the different block's in that drawing, and i believe that could be a pretty da.. handy function :):)
The "ppm" will then have all the good stuff from a "normal" Block i believe, will need to test some more on this part.

This is the ppm script i end up with;
"
Units (1[mm])

S = StaticSymbol("..\..\..\..\.."\"Symboltest2.tcw");

Output(S);
"
And "Symboltest2.tcw" is in my Macro2 folder
If you are using a English system you dont need the Units line and can delete it as TC is on "in" by default, but you can just change the "mm" to "in", the number "1" is a scale control, if you put in like "0.01" the symbol will be scaled down when inserted in to the drawing.

Torfinn
V20, V21, 2015 > 2024  Platinum
Deluxe 2015/ 16/ 19
RedSDK enabled
Windows 10 Home Premium (20H2/ 19042.1083) 64 bit, 32 GB
NVIDIA Geforce GTX 780m, 1 GB

JeffD

Thanks for the info....I really appreciate it.  I knew I was missing something.  I didn't put it in a macro because it sounded like I didn't have to, as long as I specified where to find it...I must say I do enjoy writing scripts, have made quite a few for hardware.  It's challenging but that was one I just couldn't get over...Thanks again..