one sketch dimension driven by multiple global variables

Mike Gera
Posts: 209
Joined: Mon Sep 06, 2021 1:29 pm
Answers: 0
x 93
x 36

one sketch dimension driven by multiple global variables

Unread post by Mike Gera »

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.
Attachments
global_var_test.SLDPRT
(114.04 KiB) Downloaded 128 times
SW 2024 SP 5.0
Windows 11
User avatar
Glenn Schroeder
Posts: 1527
Joined: Mon Mar 08, 2021 11:43 am
Answers: 23
Location: southeast Texas
x 1777
x 2142

Re: one sketch dimension driven by multiple global variables

Unread post by Glenn Schroeder »

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.
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.
"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"
User avatar
DanPihlaja
Posts: 862
Joined: Thu Mar 11, 2021 9:33 am
Answers: 25
Location: Traverse City, MI
x 815
x 993

Re: one sketch dimension driven by multiple global variables

Unread post by DanPihlaja »

You have to set this drop down to "This configuration" for it to work. By default it is set to "all configurations"
image.png
-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
Mike Gera
Posts: 209
Joined: Mon Sep 06, 2021 1:29 pm
Answers: 0
x 93
x 36

Re: one sketch dimension driven by multiple global variables

Unread post by Mike Gera »

Please see the screen capture below.

Thanks.
Attachments
SW_GV_bug.gif
SW 2024 SP 5.0
Windows 11
User avatar
mattpeneguy
Posts: 1386
Joined: Tue Mar 09, 2021 11:14 am
Answers: 4
x 2489
x 1899

Re: one sketch dimension driven by multiple global variables

Unread post by mattpeneguy »

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!
Mike Gera
Posts: 209
Joined: Mon Sep 06, 2021 1:29 pm
Answers: 0
x 93
x 36

Re: one sketch dimension driven by multiple global variables

Unread post by Mike Gera »

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.
Attachments
global_var_test_02.SLDPRT
(105.53 KiB) Downloaded 154 times
global_var_test_01.SLDPRT
(114.45 KiB) Downloaded 123 times
SW 2024 SP 5.0
Windows 11
User avatar
bnemec
Posts: 1954
Joined: Tue Mar 09, 2021 9:22 am
Answers: 10
Location: Wisconsin USA
x 2562
x 1411

Re: one sketch dimension driven by multiple global variables

Unread post by bnemec »

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.
Mike Gera
Posts: 209
Joined: Mon Sep 06, 2021 1:29 pm
Answers: 0
x 93
x 36

Re: one sketch dimension driven by multiple global variables

Unread post by Mike Gera »

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
User avatar
mattpeneguy
Posts: 1386
Joined: Tue Mar 09, 2021 11:14 am
Answers: 4
x 2489
x 1899

Re: one sketch dimension driven by multiple global variables

Unread post by mattpeneguy »

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.
User avatar
SPerman
Posts: 2080
Joined: Wed Mar 17, 2021 4:24 pm
Answers: 14
x 2256
x 1902
Contact:

Re: one sketch dimension driven by multiple global variables

Unread post by SPerman »

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.
ConfigFeat.gif
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
Post Reply