TurboCAD Forums

Turbo Talk => Tips and Tricks => Topic started by: murray dickinson on October 31, 2017, 09:10:33 PM

Title: parametric assembly that isn't a formal "TC parametric part" or a scripted .ppm
Post by: murray dickinson on October 31, 2017, 09:10:33 PM
There's an occasional dispute over whether or not TC's a "parametric" program or not, that is, whether it's possible to model parts or assemblies with persistent relationships that can be varied with the model rebuilding, without having to be redrawn or corrected.  I've been fooling around with constraints, and I've found that it's possible to build some pretty involved parametric models using constraints, but without having to involve the formal "format|parametric part" process or scripting.  I haven't used TC's constraints before so I was doodling and experimenting in V17 (the old version, not 2017), and this is my first result.  It's incomplete, in that I haven't reasoned the relationship that will place the middle shelf midway between the benchtop rails yet, and I didn't bother to give it doors that can be opened to whatever angle.  What I wanted to do is build something that can be shaped by using overall dimensions and probable material thickness in the most obvious way, through the variables, without having to dig through the part tree or scripting.  I know that I've gotten some things wrong, because while it works in V17, I opened the file in 2015 and 2016, and something goes wonky when the HeightOA variable is altered, but not width or cabinet depth, so I'm theorising that something's changed slightly, or I've made an error, which is more likely.   I did dabble with Alibre a long time ago, and I do recall that there was a song-and-dance, which they called "data vault" at the time, to open a file built in an older version in a newer.  Whatever....
To circumvent the 2D, not 3D, constraint limitation, I used intersected simple extrusions.  This meant that the limits to the model's size are dictated by the value of the sweep, but I just gave them arbitrary, ridiculous values that won't be approached in the normal size range of such a cabinet.  Another thing that's notable about TC's constraints is that, although they're 2D you can associate values, like applying equal length and distance, radius and probably others that I haven't considered, for entities that aren't on the same plane, which means that some things have a sort-of-3D constrainability. 
The file is nicely compact, 120kB, not that that's anything worthy these days, and things that interested me about the result are:  it can be translated in x, y and z, but not rotated or scaled (d'uh.  It just occurred to me that scaling is trivial in the calculator/variables palette.  Possibly rotation too, with a little more thought) .
However, it can be resized and copied, which breaks the associations with the constraints, rotation and realignment is unconstrained afterwards. 
IMO, TC's got a lot of capability that's all but ignored, because it doesn't work like other programs that people are more familiar with, and for which there's a lot more documentation and learning material for their particular methodology. 
Title: Re: parametric assembly that isn't a formal "TC parametric part" or a scripted .ppm
Post by: Andy H on November 01, 2017, 03:47:32 AM
Really nice work Murray,  constraints did have a lot of potential when they were bought in, its a shame it wasn't exploited by the programmes to more easily convert into full 3D 
Title: Re: parametric assembly that isn't a formal "TC parametric part" or a scripted .ppm
Post by: murray dickinson on November 01, 2017, 01:10:55 PM
Thanks Andy.  There are pitfalls that are probably obvious to people who have experience with programming or scripting, like when I changed the name of variables, they stopped working in functions/expressions.  My rookie error was putting spaces in the new names, they don't work in functions if that's done.    I don't know if that's in the documentation, but it ought to be so prominent and repeated so frequently that it can't be missed. 
Another tip is that size changes, say to the side length of a rectangle, can extend in an unwanted direction, ie, the wrong end is fixed.  Deleting the variable/dimension and applying it to the opposite side of the rectangle corrected that for me. 
Title: Re: parametric assembly that isn't a formal "TC parametric part" or a scripted .ppm
Post by: nikkipollard on November 01, 2017, 09:24:13 PM
Another way to stop things moving in the wrong direction is to use the anchor constraint.

There are  reasons I like taking this one step further and converting them to parametric parts.

1. extrude heights can be a parameter, rotation angles of a revolve can be a parameter etc - making it more 3d
2. with nested parametric parts you can move and rotate parts, as well as make copies of components.
3. You can use the math functions to work out number of copies, distances.
4. They are easy to drag into drawing from the library palette and change parameters of that specific object without having to try to figure out which parameter is relevant. You also avoid having conflicting variable names in the calculator palette.

But there are also disadvantages
1. You will need to explode them and turn them into groups or blocks - because they don't work well with the drafting palette, and the architectural section- elevation tool.
2. They don't always work in newer versions of the program.
3. the edit existing part has bugs - so you need to plan carefully, so that you don't need to use it
4. the mid constraint doesn't work
5. when you rotate a nested part using rotx roty or rotz it rotates about the center of extents of the original geometry including dimensions and  block marks - so you need to plan carefully.
Title: Re: parametric assembly that isn't a formal "TC parametric part" or a scripted .ppm
Post by: murray dickinson on November 02, 2017, 05:07:11 AM
I don't agree, Nikki.  This is a parametric assembly, not an assembly of parametric parts, so I used intersection instead of simple extrusion because the intersecting objects can both be constrained.  To coin your own term, it's even MORE "more 3D" than a constrained profile with what amounts to a thickness parameter.  The point of the parametric assembly is to be able to have the entire assembly compose itself, without having to attend to what some people call "granular" detail, ie extrusion length or material thickness for individual components.    The profiles can have linear, polynomial or compound interrelationships that can be predefined, you don't have to get "under the hood" to jigger the parameters because it's the driving dimensions, the overall height, width and depth, that are changed, the relationships of the components is already defined, although there are driving dimensions like material thickness or the material dimensions of individual components that can redefined together or separately.   Because of that, the fix geometry constraint overconstrains if it's used more than once in an assembly, because the fixed points can't alter their relationships.   
However, I'd be very interested to see if you can arrange an assembly of nested parametric parts to interact this way.  You'd know better than me if that's possible?  I deliberately built this cabinet to be similar to one that Don Cheke built in SolidWorks when this discussion flared up in a thread a while back.  Don reckoned it took him a quarter-hour or so in SW and that he did similar things regularly;  mine took me a day-and-a-half.  However,  this is the first time I've attempted it, I was teaching myself as I did it, and this afternoon I've figured out how to make the middle shelf place itself in the middle when the height is varied, how to rig parametric opening doors, and how to locate screw holes anywhere - but still not within the formal "TC parametric part" format.   I think that what I'm describing is novel use of TC, and I think that there's more to be discovered. 
Title: Re: parametric assembly that isn't a formal "TC parametric part" or a scripted .ppm
Post by: nikkipollard on November 02, 2017, 09:18:42 PM
Try your method on a whole kitchen layout or building. It can get really complicated.
Title: Re: parametric assembly that isn't a formal "TC parametric part" or a scripted .ppm
Post by: murray dickinson on November 02, 2017, 10:30:39 PM
Don't we use proxies like blocks, x-refs for that sort of thing?  :)
Title: parametrics update
Post by: murray dickinson on November 03, 2017, 03:16:21 PM
I've added door/s that can be opened, and experimented more, including using the object in later versions.  I also discovered that if the file is opened and saved to later versions, it functions as it should, but if the file is inserted or copied into a file, it behaves incorrectly, and that also applies if the file is inserted into its native version.