one sketch dimension driven by multiple global variables
one sketch dimension driven by multiple global variables
I entered (4) global variables in the attached part:
length_01 = 1.0
length_02 = 2.0
length_03 = 3.0
length_04 = 4.0
I then made (4) different configurations and attempted to link D2@Sketch1 to the 4 different global variables using the "This Configuration" setting in the dimension Modify box.
For some reason, it's not working properly. Note how, for example, "length_01" was subsequently set to "length_01". I did not do this.
What am I doing incorrectly?
Thanks for any replies.
length_01 = 1.0
length_02 = 2.0
length_03 = 3.0
length_04 = 4.0
I then made (4) different configurations and attempted to link D2@Sketch1 to the 4 different global variables using the "This Configuration" setting in the dimension Modify box.
For some reason, it's not working properly. Note how, for example, "length_01" was subsequently set to "length_01". I did not do this.
What am I doing incorrectly?
Thanks for any replies.
- Attachments
-
- global_var_test.SLDPRT
- (114.04 KiB) Downloaded 55 times
SW 2024 SP 5.0
Windows 11
Windows 11
- Glenn Schroeder
- Posts: 1520
- Joined: Mon Mar 08, 2021 11:43 am
- Location: southeast Texas
- x 1758
- x 2129
Re: one sketch dimension driven by multiple global variables
I suspect you made the mistake when you attempted to link to the global variable. I changed the global variables back to 1.0 and 2.0, and then it linked just fine. What method did you use to attempt to link to the global variable? I set the dimension Modify box to this configuration, cleared the value that was there, and hit the Equal symbol on my keyboard. That allowed me to select the global variable from the drop-down.Mike Gera wrote: ↑Wed Mar 27, 2024 1:35 pm I entered (4) global variables in the attached part:
length_01 = 1.0
length_02 = 2.0
length_03 = 3.0
length_04 = 4.0
I then made (4) different configurations and attempted to link D2@Sketch1 to the 4 different global variables using the "This Configuration" setting in the dimension Modify box.
For some reason, it's not working properly. Note how, for example, "length_01" was subsequently set to "length_01". I did not do this.
What am I doing incorrectly?
Thanks for any replies.
"On the days when I keep my gratitude higher than my expectations, well, I have really good days."
Ray Wylie Hubbard in his song "Mother Blues"
Ray Wylie Hubbard in his song "Mother Blues"
- DanPihlaja
- Posts: 847
- Joined: Thu Mar 11, 2021 9:33 am
- Location: Traverse City, MI
- x 811
- x 978
Re: one sketch dimension driven by multiple global variables
You have to set this drop down to "This configuration" for it to work. By default it is set to "all configurations"
-Dan Pihlaja
Solidworks 2022 SP4
2 Corinthians 13:14
Solidworks 2022 SP4
2 Corinthians 13:14
Re: one sketch dimension driven by multiple global variables
Please see the screen capture below.
Thanks.
Thanks.
SW 2024 SP 5.0
Windows 11
Windows 11
- mattpeneguy
- Posts: 1386
- Joined: Tue Mar 09, 2021 11:14 am
- x 2489
- x 1899
Re: one sketch dimension driven by multiple global variables
On my phone so can't really see the animation. But try not using underscores in your variable names.
About 10 years ago underscores in custom property names gave me all kinds of weird results...and it wasn't documented anywhere!
About 10 years ago underscores in custom property names gave me all kinds of weird results...and it wasn't documented anywhere!
Re: one sketch dimension driven by multiple global variables
I was able to get it to work both with and without underscores in the variable names.
See attached files, if interested.
I went through and eradicated everything, then systematically linked the variables via the "Equations, Global Variables, and Dimensions" window.
Setting the variables at the sketch level doesn't seem to work. I will go so far as to say there's a bug.
See attached files, if interested.
I went through and eradicated everything, then systematically linked the variables via the "Equations, Global Variables, and Dimensions" window.
Setting the variables at the sketch level doesn't seem to work. I will go so far as to say there's a bug.
- Attachments
-
- global_var_test_02.SLDPRT
- (105.53 KiB) Downloaded 71 times
-
- global_var_test_01.SLDPRT
- (114.45 KiB) Downloaded 65 times
SW 2024 SP 5.0
Windows 11
Windows 11
Re: one sketch dimension driven by multiple global variables
I tried to copy your process and the behavior was not repeatable in 2019SP4. I was thinking maybe you had dirieved configs, but I didn't see that any were indented (treed) in the drop down menu.
I did notice some strange behavior in the global variable selector that might point to something. When you link the first GV you get all four of them. When you link to the second GV all four are still listed. When you link the third one the list only shows gv03 and gv04. It feels like something may have gone wrong when applying the second GV.
I did notice some strange behavior in the global variable selector that might point to something. When you link the first GV you get all four of them. When you link to the second GV all four are still listed. When you link the third one the list only shows gv03 and gv04. It feels like something may have gone wrong when applying the second GV.
Re: one sketch dimension driven by multiple global variables
I'm just now discovering that Global Variables aren't needed for what I'm trying to accomplish here. Hard values can be assigned to a dimension across multiple configurations. That seems to be reliable with no issues.
SW 2024 SP 5.0
Windows 11
Windows 11
- mattpeneguy
- Posts: 1386
- Joined: Tue Mar 09, 2021 11:14 am
- x 2489
- x 1899
Re: one sketch dimension driven by multiple global variables
You can also use a Design Table. You are using a previous version of SW than what I have installed. So, I can't post a file that you can open.
Seeing your original post, I thought you had a specific need to do it the way you were.
Seeing your original post, I thought you had a specific need to do it the way you were.
Re: one sketch dimension driven by multiple global variables
You are probably aware of this, but you can right click on the sketch and chose "Configure Feature" and see all of the dimensions for the configurations in one place. You can also do the same thing for the extrude feature.
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams