Page 1 of 1
Equation function "INT" doesn't seem to work
Posted: Fri Nov 08, 2024 10:52 am
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
Re: Equation function "INT" doesn't seem to work
Posted: Fri Nov 08, 2024 12:50 pm
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 (6.18 KiB) Viewed 1546 times
Re: Equation function "INT" doesn't seem to work
Posted: Fri Nov 08, 2024 1:20 pm
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
Re: Equation function "INT" doesn't seem to work
Posted: Fri Nov 08, 2024 2:12 pm
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.
Re: Equation function "INT" doesn't seem to work
Posted: Fri Nov 08, 2024 5:18 pm
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.
Re: Equation function "INT" doesn't seem to work
Posted: Sat Nov 09, 2024 12:01 am
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.
Re: Equation function "INT" doesn't seem to work
Posted: Mon Nov 11, 2024 2:59 pm
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.
Re: Equation function "INT" doesn't seem to work
Posted: Mon Nov 11, 2024 3:14 pm
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...
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.
Re: Equation function "INT" doesn't seem to work
Posted: Fri Nov 15, 2024 10:28 am
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.
Re: Equation function "INT" doesn't seem to work
Posted: Fri Nov 15, 2024 10:34 am
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
Re: Equation function "INT" doesn't seem to work
Posted: Fri Nov 15, 2024 11:09 am
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.
Re: Equation function "INT" doesn't seem to work
Posted: Fri Nov 15, 2024 11:32 am
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....
Re: Equation function "INT" doesn't seem to work
Posted: Mon Nov 25, 2024 4:57 am
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.
Re: Equation function "INT" doesn't seem to work
Posted: Mon Nov 25, 2024 7:40 am
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
Re: Equation function "INT" doesn't seem to work
Posted: Mon Nov 25, 2024 7:46 am
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.)
Re: Equation function "INT" doesn't seem to work
Posted: Mon Nov 25, 2024 8:12 am
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.
Re: Equation function "INT" doesn't seem to work
Posted: Mon Nov 25, 2024 9:31 am
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.