Smart dimension gives wrong result

pdesigns
Posts: 2
Joined: Wed Jun 28, 2023 6:54 am
Answers: 0

Smart dimension gives wrong result

Unread post by pdesigns »

Hi!

I'm trying to use the functions to dimension a skecth, but it always gives me the wrong result. In this case i'm using a smart dimension of 629mm dived by 17.813mm. the result should be 35.311mm, but it gives me 34mm every single time...

I'm trying to do a parametric guitar fretboard and need accurate results for each fret.

What I'm I doing wrong?
Attachments
imagem_2023-06-28_121103719.png
by XHawkeye » Wed Jun 28, 2023 9:21 am
Capture175.JPG
Need to use the / for divide.

Don't know what the \ is doing.
Go to full post
User avatar
XHawkeye
Posts: 52
Joined: Thu Apr 08, 2021 4:45 pm
Answers: 1
Location: DFW
x 61
x 47

Re: Smart dimension gives wrong result

Unread post by XHawkeye »

Capture175.JPG
Need to use the / for divide.

Don't know what the \ is doing.
pdesigns
Posts: 2
Joined: Wed Jun 28, 2023 6:54 am
Answers: 0

Re: Smart dimension gives wrong result

Unread post by pdesigns »

yep, that does it!!

Thank you very much!!

Don't know how what I was thinking...
User avatar
josh
Posts: 304
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 16
x 22
x 514

Re: Smart dimension gives wrong result

Unread post by josh »

The backslash operator is actually VBA and is used for integer division. I'm a little surprised the equation editor accepts it...

https://learn.microsoft.com/en-us/offic ... h-operator
User avatar
bnemec
Posts: 1954
Joined: Tue Mar 09, 2021 9:22 am
Answers: 10
Location: Wisconsin USA
x 2562
x 1411

Re: Smart dimension gives wrong result

Unread post by bnemec »

josh wrote: Wed Jun 28, 2023 10:09 am The backslash operator is actually VBA and is used for integer division. I'm a little surprised the equation editor accepts it...

https://learn.microsoft.com/en-us/offic ... h-operator
That's interesting. Going a bit off thread but seeing how the \ operator is interpreted got me thinking.

does % work?
image.png
image.png (9.23 KiB) Viewed 1130 times
ok how about this?
image.png
image.png (11.1 KiB) Viewed 1130 times
ok, this maybe?
image.png

That's interesting...
User avatar
josh
Posts: 304
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 16
x 22
x 514

Re: Smart dimension gives wrong result

Unread post by josh »

SolidWorks actually uses VBA to evaluate equations. I notice you are trying to use MOD…. You’re using Excel syntax, which won’t work. Any VBA works. However, for some reason (probably trying to protect users from themselves), the syntax checker that watches what you’re typing will only accept certain VBA. If you can manage to bypass the syntax checker, you can get Equations to execute whatever VBA you want. One way to do this is to hide your VBA in a custom property.

If you try to make a global variable equal to =8 mod 3, the equation syntax checker won’t let you. However, if you create a custom property, say, “test” and make its value “8 mod 3” (note the “=” sign is not there), you can then go to the equation interface and make your global variable equation =”test”. The syntax checker will recognize that “test” is linked to a custom property, but it will not check the property text for syntax. After syntax check, it will replace the custom property name with its value and then hand that to VBA for evaluation and you’ll get a result of 2.
Post Reply