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.

multiple copies of a 3D element with variable dimension(s)

Started by m_ke, December 09, 2021, 01:19:39 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

m_ke

Hello,
can I ask what would be your recommended way to achieve the following:
I want to have a larger pole in the middle of a 3D something, to which a couple of smaller rods are attached. I'd like to have the thickness of the rods (cylinders, essentially) as variable, but so far I have just succeeded to have that for the first element. The other rods, which are copies of the first one, arranged in a circular manner, don't follow the variable setting.

I have created the copies by "Make copy" = On in the Inspector Bar and then adding 90° offsets and so on...
The variable in the attached drawing is called Arm_D and is currently set to 6mm. It only affects the original rod.

Any suggestions?
I'm using TurboCAD 2021 Platinum

Many thanks in advance,
mike
TurboCAD 2024 Platinum 64-bit
RedSDK 2024 Plugin 64-bit

nikkipollard

I would use the pattern tools. If the part tree is on you can edit a pattern piece and all it's copies will change too.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Alvin Gregorio

Formatting the original as a Block, before making the copies, wouldn't work here?

(I haven't reviewed the file; I'm working with version 2020)
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

#3
Another way is to use a simple extrusion or rail sweep with a circle as constrained compound profile, with copies, radial or arbitrary.  I'd use its radial dimension as a named variable and use =[variable name] as formula (in the variables palette) for the copies' profile's dimension, because the copies can be placed or spaced anywhere and the formula constraint relationship carries across workplanes without there necessarily having to be a pattern or array relationship.   

Alvin Gregorio

Quote from: murray dickinson on December 09, 2021, 04:57:18 AM
Another way is to use a simple extrusion or rail sweep with a circle as constrained compound profile, with copies, radial or arbitrary.  I'd use its radial dimension as a named variable and use =[variable name] as formula (in the variables palette) for the copies' profile's dimension, because the copies can be placed or spaced anywhere and the formula constraint relationship carries across workplanes without there necessarily having to be a pattern or array relationship.

I was confident that what you suggested works Murray.  Using Constraints.  But I am not getting the copied instances of the Constrained object to update, reflecting the Variable changes to the Diameter and Sweep Line values.   I thought they would, until I tested it.

If I include the 2D Profiles and the Constraints, including the Dimension Constraints (Variables), in the Copy process, that works; albeit, my having to alter the Formulas for the copied Variables to essentially be "=(original Variable)".

Take note, as not fully unexpected, TurboCAD crashed when I started doing the above.
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

Attached is an example, using TurboCAD's Constraints.
It is currently in Perspective View; so turn that off if exploring.

I recommend having "Show variable name in dimension text", in Options|Constraints, active while initially exploring the file.
It's best to make editions to the Variables in the Calculator Palette only while in Wireframe visual style.

Note that I immediate used Formulas.  That is to lessen the probability of Constraints' conflicts.  I would stay with the DI (Diameter) as being an entered value; but perhaps change the integer in the HT (Height) Formula.  All other Dia(meters) and H(eight)ts should update accordingly; they do for me.

Also for clarity, you might want to set some Layers to Invisible and/or deactivate Foreground Wireframes in Draft, Quality, and/or Advanced render styles.

Just an example...
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

#6
I found that if I copied instances of the child constraint the formula doesn't copy, Alvin.  It has to be copy/pasted in the variables palette, so I didn't bother copying the constraint, only the profile, auto-dimensioning them after, then adding the formula. 

m_ke

Quote from: nikkipollard on December 09, 2021, 03:42:59 AM
I would use the pattern tools. If the part tree is on you can edit a pattern piece and all it's copies will change too.

Thanks, Nikki. That works. However I find it a bit inconvenient to actually modify the original in that approach. It cannot be a constrained part (pattern tools would not allow that), so you have to walk in on the part in the part tree, as you said. Anyway, good to know!

Quote from: Alvin Gregorio on December 09, 2021, 08:25:44 AM
Quote from: murray dickinson on December 09, 2021, 04:57:18 AM
Another way is to use a simple extrusion or rail sweep with a circle as constrained compound profile, with copies, radial or arbitrary.  I'd use its radial dimension as a named variable and use =[variable name] as formula (in the variables palette) for the copies' profile's dimension, because the copies can be placed or spaced anywhere and the formula constraint relationship carries across workplanes without there necessarily having to be a pattern or array relationship.

I was confident that what you suggested works Murray.  Using Constraints.  But I am not getting the copied instances of the Constrained object to update, reflecting the Variable changes to the Diameter and Sweep Line values.   I thought they would, until I tested it.

If I include the 2D Profiles and the Constraints, including the Dimension Constraints (Variables), in the Copy process, that works; albeit, my having to alter the Formulas for the copied Variables to essentially be "=(original Variable)".

Take note, as not fully unexpected, TurboCAD crashed when I started doing the above.

That's the approach that I had originally tried but couldn't get working. After checking your example file (thanks for that!), Murray, I found where I went wrong ...and something else I could impossibly have anticipated I'd say:

First of all I missed that while copying the 3D object I have to actively include the profile that was used to create it.
Then, as Alvin wrote, I have to add the dimension to the selection before copying, if I want it to copy over.
Thirdly (and this actually messed up some of my alternative trials to work with constraints and variables in the first place): TurboCAD would not allow underscores in the variable names. Well, it would allow them, but then simply ignore an update of the original variable.
So for example Var1 = 6mm (fixed value), Var2 = Var1 (formula) would work
But Var_1 = 6mm (fixed value), Var2 = Var_1 (formula) would not work.

Does it behave the same way on your side?

Thanks for your help, The suggested methods perfectly do the job for me.

Best regards,
--mike
TurboCAD 2024 Platinum 64-bit
RedSDK 2024 Plugin 64-bit

Alvin Gregorio

#8
Quote from: m_ke on December 10, 2021, 04:39:48 AM
...

Does it behave the same way on your side?

...

Yes, it behaves the same way for me.  I have found some-- many-- other characters do not work, including spaces (in the Formulas).  Rather than try to discover them all, I have decided to just stick with basic alpha-numeric characters--and no spaces-- moving forward.  The less "cute" or contrived, the better.
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

There's D-Cubed constraints in Pre-IMSI and IMSI Shark, I should investigate to see if the same character limitations apply there, and even in the old TC Solid Modeller from pre-2000 (originally a Corel CAD), it might be D-Cubed/Siemens rather than IMSI who exclude those characters. 

Alvin Gregorio

I'm not sure why this didn't occur to me before.
How about a combo-- Constraints and Blocks.  Constrained Block.

In the attached, if you go to Edit (Block) Contents, the Calculator Palette displays accordingly.
The vertical rod and the horizontal rod are all instances of the same Block.

An External Reference (XRef) might be another way to go.  TurboCAD is prone to crashes and losing things; more so when using Constraints.  With using a Constrained XRef, less likely to lose everything or most of everything if TurboCAD goes awry.
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

I have almost no problems with TC being unstable or tending to crash.  Perhaps it's because I deal almost exclusively with native TC files, not having to accommodate .dwg or files from other apps that might have active features or associations that TC is expected to manage.  Some things don't always work as expected, but I'm wary of blanket assertions like TC being prone to crashing.  I use TC on five or six different devices regularly, usually 2015 and 2016 because of licensing considerations, crashing is unusual in my usage and experience.  Not intending to be combative, Alvin, your experience is your own, but fair's fair.

Alvin Gregorio

#12
I was mostly referring to TurboCAD being prone* to crashing when using Constraints.  Particularly when using a lot of Constraints.  It can be greatly mitigated by using as many (functional) Formulas as possible, and minimize the use of "hard entry" Values.

Plus I was probably influenced by and voicing my frustration with my recent experience in my "complex" 3D/2D house as-built/remodel/addition project.  Crashed. Mucho.
_______
Hah!  I just re-Opened that last Constraint file (#3) that I just shared.  Went to Edit (Block) Contents; the Calculator Palette is empty.   :-\ :P
____
*admittedly, "prone" is not the correct term; "prone" connotes that it occurs more often than it does not, which, in my limited experience using Constraints, I have to admit is not the case.
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

#13
Since TurboCAD lost the Constraints in the Block after the Save and re-Open, I tried the XRef idea.
Seems to work pretty good.

After initially creating/inserting an External Reference (XRef) into the Destination file:

In the Destination file, one can go to the bottom of the Block Palette, right-click on the External Reference name and click Open; then when the Source file opens, make the editions in the Calculator Palette, and Save (don't need to Close it).  Then back in the Destination file, Reload that XRef Source file, either by clicking on EC at the top of the Blocks Palette, or by right-clicking on the External Reference file in the lower pane of the Blocks Palette.

After having inserted that XRef Block into Modelspace in the Destination file, make Copies as wanted.
All Copies will edit in accordance with the XRef Source edits done and Reloaded per the above paragraph.

I like 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)

murray dickinson

That's good if you want all instances the same, but an advantage of constraints and variables is that you can use the same source factors with differing formulas to have child objects that fit the pattern with varied size and proportion. 

Alvin Gregorio

That's how this conversation thread started.  M_ke requested that edits to the first instance of the rod be propagated (wrong word; help me) throughout the multiple copies of that rod.
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

Propagate's the right word.   It's quite sophisticated to be able to address relative OR absolute edits to individuals amongst those copies, though.   

Alvin Gregorio

Quote from: murray dickinson on December 10, 2021, 04:46:20 PM
Propagate's the right word.   It's quite sophisticated to be able to address relative OR absolute edits to individuals amongst those copies, though.   

Okay, I'll sleep on that (the OR thing).
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

#18
 I think constraints would be difficult because of all the different levels.

Because you want to be able to adjust parameters - this is an ideal scripting project.
It would  be very easy to create using a ppm. (Turbocad scripted parametric symbol)

//Karasull
Units (1[mm])

//Parameters

CR = Parameter("Centre pole Radius",20,LINEAR)
CH = Parameter("Centre pole Height",120,LINEAR)
AR = Parameter("Arm Radius",3,LINEAR)
AL = Parameter("Arm Length",200,LINEAR)
BR = Parameter("Ball Radius",6,LINEAR)
H1 = Parameter("First Row height",76,LINEAR)
P = Parameter("Arm Angle",-5,Interval(-90,90))
APR = Parameter("Number of arms in row",4,Interval(1,10))
NR = Parameter("Number of Rows",4,Set(2,4,6,8,10,12))
RS =  Parameter("vertical centres",12,LINEAR)
//Centre Pole

cp1 = Circle(CR)
cp2 = Polyline(Point(0,0,0),Point(0,0,CH))
Pole = Sweep(cp1,cp2)

//arm

am1 = Circle(AR)
am2 = RotateY(am1,90)
am3 = Polyline(Point(0,0,0),Point(AL,0))
am4 = Sweep(am2,am3)
am5 = Sphere(BR,AL,0)
am6 = BooleanUnion(am5,am4)
am7 = RotateY(am6,P)
am8= Move(am7,0,0,H1)
Arm= BooleanSubtract(am8,Pole)
//make copies
RA = 360/APR
row = RotateZ(Arm,RA,0,0,APR-1)
row1 = Group(Arm,row)
row2 = RotateZ(row1,RA/2)
row3 = Move(row2,0,0,RS)
num1 = NR/2
num2 = NR-num1
row5 = Move(row1,0,0,RS*2,num1-1)
row6 = Move(row3,0,0,RS*2,num2-1)
//Reference Point
RefP = RefPoint(0,0)

Output(RefP,Pole,Arm,row1,row3,row5,row6)



Copy this into the parametric script editor palette, save it and press the blue arrow.
the parameters can be changed in the selection info palette.
I have got the pattern wrong so you will need to experiment with the script
It is metric - beacause I think your drawing was metric.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

m_ke

Your additional inputs are highly appreciated.
It gives me some homework, particularly the scripting approach. I haven't dared to touch scripts, yet; just started TurboCAD a few months ago...
But having an example or a reference to start with is as good as a tutorial. So thanks a lot for the time you spent on it.
Mike
TurboCAD 2024 Platinum 64-bit
RedSDK 2024 Plugin 64-bit

murray dickinson

Nikki, like Mike, I've never even attempted to use a PPM before this one you've posted, I'm intimidated by learning syntax, but running each line and seeing what it's doing is great, and of course I couldn't know how being able to edit the parameters could work.  Thank you!   You've given me a bit of an epiphany...   

nikkipollard


Quote from: murray dickinson on December 11, 2021, 04:58:38 PM
Nikki, like Mike, I've never even attempted to use a PPM before this one you've posted, I'm intimidated by learning syntax, but running each line and seeing what it's doing is great, and of course I couldn't know how being able to edit the parameters could work.  Thank you!   You've given me a bit of an epiphany...   
Murray are you referring to defining the parameters or changing them?
You change parameter in the selection info palette.
They are defined in the script.

CR = Parameter("Centre pole Radius",20,LINEAR)
CR is the identifier - whenever you need to use the parameter in the script you use CR
Each identifier needs to be unique
To define a parameter you use the Parameter function - open and close brackets to start and end the function
Separate Function arguments with a comma
Arguments are expected in order.
"Centre pole radius" - this is the same as a tag in a block attribute ,this is what you will see in the selection info palette
they need to be unique
20 is the default value
LINEAR is the type of parameter
You can also have
TEXT
FONT
or CHECKBOX


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

murray dickinson

Both, Nikki.  Your script is very clear and obvious, and I'm delighted to find how it's editable in the palette.  It's also very nice that scripts work in versions back to V15 and are parametrically editable in them too.  Pretty cool.  I don't think that constraints are difficult or more difficult in the context of this design, which I hadn't seen because no 2021, but your script is great.

Alvin Gregorio

Are you going to pursue learning Parametric (PPM) scripting in TurboCAD Murray?
If so, I'd share something with you that should make the learning process easier (than following along with the Help Documentation, because all versions of it I have reviewed are formatted poorly in the HTML version, and be quite confusing and befuddling to follow, unfortunately).
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

Yes, Alvin, and if you're willing to share something else that'll help, I'd appreciate that too.  Thanks for the offer.

Alvin Gregorio

Quote from: murray dickinson on December 12, 2021, 12:12:09 PM
Yes, Alvin, and if you're willing to share something else that'll help, I'd appreciate that too.  Thanks for the offer.

It'll be in your Forum Personnel Message Inbox today or tomorrow Murray.
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)