Equation function "INT" doesn't seem to work

User avatar
charlesculp
Posts: 17
Joined: Fri Mar 26, 2021 3:52 pm
Answers: 0
x 3
x 13

Equation function "INT" doesn't seem to work

Unread post by charlesculp »

Am I missing something? I am trying to add an extra sheet at the end of all drawings. Because it is not part of the drawing itself, I need the page count for the drawing to be less than the actual calculated page count. I tried to use an equation in the custom properties to make this happen.

To do this, it does some math, but it looks like it turns it into a floating point number, and uses the length unit standard tolerance for significant digits (three past the .). Ok, so I used the "int" function, but it does nothing. What gives?

Shouldn't

Code: Select all

int ( $PRP:"SW-Total Sheets" - 1 )
return an integer? Solidworks 2022 SP5.0

image.png
User avatar
jcapriotti
Posts: 1896
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 32
Location: The south
x 1233
x 2023

Re: Equation function "INT" doesn't seem to work

Unread post by jcapriotti »

Hey Charles, long time.

I don't see a way to make this work with the equations in custom properties. The INT function is working somewhat if you put a decimal value in like 5.523, it changes it to 5.000. Excel does the same thing if you have decimal place formatting set on the cell.
image.png
image.png (6.18 KiB) Viewed 1543 times
Jason
User avatar
JSculley
Posts: 648
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 884

Re: Equation function "INT" doesn't seem to work

Unread post by JSculley »

Yeah, the INT function is borked. You wouldn't be bothering with this at all if this SPR were addressed:

SPR769752 - Ability to set certain drawing sheets to be ignored from total sheet count
User avatar
charlesculp
Posts: 17
Joined: Fri Mar 26, 2021 3:52 pm
Answers: 0
x 3
x 13

Re: Equation function "INT" doesn't seem to work

Unread post by charlesculp »

JSculley wrote: Fri Nov 08, 2024 1:20 pm Yeah, the INT function is borked. You wouldn't be bothering with this at all if this SPR were addressed:

SPR769752 - Ability to set certain drawing sheets to be ignored from total sheet count
Nice, I will +1 that SPR.

Nice to hear from you, Jason. Back doing engineering work again after a decade as a manager.
User avatar
josh
Posts: 300
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 16
x 22
x 511

Re: Equation function "INT" doesn't seem to work

Unread post by josh »

I hope that's an old pic you're using there for your profile... I've considered you somewhat of a colleauge for almost as many years as you look old in that pic.
User avatar
gupta9665
Posts: 420
Joined: Thu Mar 11, 2021 10:20 am
Answers: 25
Location: India
x 437
x 458

Re: Equation function "INT" doesn't seem to work

Unread post by gupta9665 »

You may have to use a macro that counts the total sheet, subtract 1 and update the custom property. Downside, run macro every time you add/remove a sheet. A macro or add-in to run in the background and act on file save might help updating the sheet count.
Deepak Gupta
SOLIDWORKS Consultant/Blogger
User avatar
charlesculp
Posts: 17
Joined: Fri Mar 26, 2021 3:52 pm
Answers: 0
x 3
x 13

Re: Equation function "INT" doesn't seem to work

Unread post by charlesculp »

josh wrote: Fri Nov 08, 2024 5:18 pm I hope that's an old pic you're using there for your profile... I've considered you somewhat of a colleauge for almost as many years as you look old in that pic.
That was at least four haircuts ago. I had to get it trimmed when I started going on job interviews. It's all still there, though. The picture is from 2021, I believe.

My solution was to do this Solidworks PDM Dispatch Action (during check-out) by creating two variables, one that is the $PRP:"Total Sheets" and the other is the new calculated value. It determines if there is the attached change sheet at the end, and then if there is it subtracts a page from the total. This afternoon I will make it work for a variable number of change sheets; in case the designer gets ambitious and makes multiple pages worth of changes at a time.
image.png
User avatar
AlexLachance
Posts: 2208
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2398
x 2040

Re: Equation function "INT" doesn't seem to work

Unread post by AlexLachance »

JSculley wrote: Fri Nov 08, 2024 1:20 pm Yeah, the INT function is borked. You wouldn't be bothering with this at all if this SPR were addressed:

SPR769752 - Ability to set certain drawing sheets to be ignored from total sheet count
So um, I'm trying to vote on this SPR, but can't seem to find where anymore. I used to do it through the Knowledge base but it doesn't seem to work anymore, I get the search result, but can't vote on it. I tried looking up on the Platform but didn't find any topic on the platform linked to it either...
image.png
https://support.3ds.com/knowledge-base/ ... :SPR769752

Edit: Is it the badge on the right of the title to "Add to Favorites" that counts as a vote? If so, that is truely intuitive, feels just as intuitive as the platform.
User avatar
charlesculp
Posts: 17
Joined: Fri Mar 26, 2021 3:52 pm
Answers: 0
x 3
x 13

Re: Equation function "INT" doesn't seem to work

Unread post by charlesculp »

josh wrote: Fri Nov 08, 2024 5:18 pm I hope that's an old pic you're using there for your profile... I've considered you somewhat of a colleauge for almost as many years as you look old in that pic.
I updated my avatar for you. Funny story, I was at the grocery store with my daughter, who is 11, and we were getting a week's worth of groceries. Then I thought of something we forgot. I ran back to get it, while my daughter put all the groceries on the checkout conveyor. When I get back the cashier was patiently waiting for my return, because the mirin in our purchase contains alcohol.

So, I was carded last week for the first time in probably a decade.
User avatar
charlesculp
Posts: 17
Joined: Fri Mar 26, 2021 3:52 pm
Answers: 0
x 3
x 13

Re: Equation function "INT" doesn't seem to work

Unread post by charlesculp »

As for setting the page numbers, I now do it TWO ways. On Checkin, PDM will run a refresh on the page numbers. I also added a macro to do it, whenever someone adds a DCN to the drawing. So, I did it both ways, neither using custom property equations. The Dispatch is shown above, the VBA code is below. This is a snippet of the appropriate portion.

Code: Select all

NewPropertyNames(28) = "DCN Total Sheets" ' total sheets in the regular drawing
NewPropertyNames(29) = "DCN Pages" ' total pages in the DCN
If SheetNames(UBound(SheetNames)) = "DCNSheet2" Then ' If the last sheet in the list is "DCNSheet2", then total number of regular drawing sheets is the total sheet count minus 2. Keep in mind arrays start at zero, not one
    NewPropertyValues(28) = UBound(SheetNames) - 1 ' arrays start at zero, so the total number of drawing sheets is one larger than the upper bound of SheetNames
    NewPropertyValues(29) = 2
Else
    NewPropertyValues(28) = UBound(SheetNames) ' arrays start at zero, so the value of the upper bound of this array is one less than the total number of sheets in the solidworks document.
    NewPropertyValues(29) = 1
End If
NewPropertyTypes(28) = 3
NewPropertyTypes(29) = 3

' This one updates all values to what is shown
For i = 27 To UBound(NewPropertyNames)
    value = propMgr.Add3(NewPropertyNames(i), NewPropertyTypes(i), NewPropertyValues(i), swCustomPropertyAddOption_e.swCustomPropertyReplaceValue) ' adds any custom properties missing
Next i

User avatar
josh
Posts: 300
Joined: Thu Mar 11, 2021 1:05 pm
Answers: 16
x 22
x 511

Re: Equation function "INT" doesn't seem to work

Unread post by josh »

charlesculp wrote: Fri Nov 15, 2024 10:28 am I updated my avatar for you.
Ya still look way too young... :-D I'd card you.
User avatar
JSculley
Posts: 648
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 884

Re: Equation function "INT" doesn't seem to work

Unread post by JSculley »

charlesculp wrote: Fri Nov 15, 2024 10:34 am As for setting the page numbers, I now do it TWO ways. On Checkin, PDM will run a refresh on the page numbers. I also added a macro to do it, whenever someone adds a DCN to the drawing. So, I did it both ways, neither using custom property equations. The Dispatch is shown above, the VBA code is below. This is a snippet of the appropriate portion.
FYI: You can also add a macro feature to your drawing template so that the necessary code will run every time the drawing is rebuilt. A little automation always helps. Users often forget to run macros or follow procedures, etc....
dave.laban
Posts: 327
Joined: Thu Mar 11, 2021 8:38 am
Answers: 5
x 48
x 394

Re: Equation function "INT" doesn't seem to work

Unread post by dave.laban »

AlexLachance wrote: Mon Nov 11, 2024 3:14 pm So um, I'm trying to vote on this SPR, but can't seem to find where anymore. I used to do it through the Knowledge base but it doesn't seem to work anymore, I get the search result, but can't vote on it. I tried looking up on the Platform but didn't find any topic on the platform linked to it either...

image.png

https://support.3ds.com/knowledge-base/ ... :SPR769752

Edit: Is it the badge on the right of the title to "Add to Favorites" that counts as a vote? If so, that is truely intuitive, feels just as intuitive as the platform.
You can't vote for things in 3DSupport / KB any more. Legacy SPRs need creating manually in 3DSwym - I've just done that for 769752. Vote away.
User avatar
AlexLachance
Posts: 2208
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2398
x 2040

Re: Equation function "INT" doesn't seem to work

Unread post by AlexLachance »

dave.laban wrote: Mon Nov 25, 2024 4:57 am You can't vote for things in 3DSupport / KB any more. Legacy SPRs need creating manually in 3DSwym - I've just done that for 769752. Vote away.
Geez, that is soooo intuitive
User avatar
SPerman
Posts: 2068
Joined: Wed Mar 17, 2021 4:24 pm
Answers: 14
x 2247
x 1889
Contact:

Re: Equation function "INT" doesn't seem to work

Unread post by SPerman »

Got a long list of bugs you're never going to get around to fixing? Purge the system and put the burden on the end user to re-crate all of those problems (that your still never going to get around to fixing.)
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
User avatar
TRKemp
Posts: 74
Joined: Tue Apr 27, 2021 10:25 am
Answers: 0
x 2
x 60

Re: Equation function "INT" doesn't seem to work

Unread post by TRKemp »

Interesting thread. I've always wondered if I could add an extra sheet for customer specifications / notes / job specific requirements without it being included in the final sheet count. But it does sound like its still a complicated problem, with no easy solution.
User avatar
jcapriotti
Posts: 1896
Joined: Wed Mar 10, 2021 6:39 pm
Answers: 32
Location: The south
x 1233
x 2023

Re: Equation function "INT" doesn't seem to work

Unread post by jcapriotti »

I've had this need for many years now, we just manually set the sheet number in those cases. Just curious, does any other CAD system do this? I think it helps when filling our the enhancement to mention the other CAD tool, maybe help steer it down the process of a competitor has this feature.
Jason
Post Reply