Convert Number to Letter?
Convert Number to Letter?
Is there any way to have a dimension number display as a corresponding letter?
I have a method for increasing the numbers sequentially on a hole pattern grid, however in the other direction the holes are marked with letters. I can use the same method connecting the array pattern to the numbers but is there a way to then convert those numbers into corresponding letters?
As an example I have a 10X10 grid pattern. 1 thru 10 are used to number the holes vertically. I have accomplished that. I can do the same thing and get 1 thru 10 horizontally but instead of 1, 2, 3 etc I want A, B, C. Can something be done with the font? Create a new font that displays A instead of 1?
I have a method for increasing the numbers sequentially on a hole pattern grid, however in the other direction the holes are marked with letters. I can use the same method connecting the array pattern to the numbers but is there a way to then convert those numbers into corresponding letters?
As an example I have a 10X10 grid pattern. 1 thru 10 are used to number the holes vertically. I have accomplished that. I can do the same thing and get 1 thru 10 horizontally but instead of 1, 2, 3 etc I want A, B, C. Can something be done with the font? Create a new font that displays A instead of 1?
Re: Convert Number to Letter?
To me this is an obvious candidate for a macro.
Other than that the first method that springs to mind is to make multiple individual sketches (with a,b,c...) And then use feature suppression in equations.
+1 for the font idea
Other than that the first method that springs to mind is to make multiple individual sketches (with a,b,c...) And then use feature suppression in equations.
+1 for the font idea
Re: Convert Number to Letter?
I'm sure this could be done with a macro but the application I'm using this in is actually a Drive works assembly model. So the macro would have to be run on a part that is part of an assembly that is being driven by Driveworks....which seems excessive.
The font idea I like for it's simplicity but then it would mean that everyone running the driveworks model would also need that font and that can sometimes be difficult.
Re: Convert Number to Letter?
IF you can get a translated font then wouldn't that have to be selectively applied, i.e., only applied to the characters in that one dimension?MJuric wrote: ↑Tue May 04, 2021 8:18 am I'm sure this could be done with a macro but the application I'm using this in is actually a Drive works assembly model. So the macro would have to be run on a part that is part of an assembly that is being driven by Driveworks....which seems excessive.
The font idea I like for it's simplicity but then it would mean that everyone running the driveworks model would also need that font and that can sometimes be difficult.
I have not used DriveWorks, but my understanding is that it is heavily grounded in Excel and the SWX Design Table functionality. I use DT's for a ton of stuff just because of the power of Excel. I find Excel functions easier to use and more extensive than the equation editor so I'll even use a DT sometimes for a part with only one configuration. In Excel there are several different ways to easily customize a numerical value to display an alpha character instead. Do you not have access to the Excel functions by using DesignWorks?
Brick walls are there for a reason. The brick walls aren't there to keep us out. The brick walls are there to show us how badly we want things.
- - -Randy Pausch
- - -Randy Pausch
Re: Convert Number to Letter?
Yes, that's exactly what I was thinking.
Good question that I do not have the answer too. Driveworks uses a lot of Excel functionality in it but so far, at least with express, I've not run into any direct access to Excel. In fact there are several limits to Express, like not being able to use variables, that would make me think direct access to Excel is not likely. Yes, if you have some massive drawn out formula it has to ALL be in a single formula in express. Annoying to say the least but it still works....and it's free.
That being said converting this inside Excel is pretty straight forward so I wonder if I can convert right inside SW somehow.
Re: Convert Number to Letter?
Quick Google http://help.solidworks.com/2018/english ... xpress.htm
"You can enter standard Microsoft™ Excel functions directly into the DriveWorksXpress Rule Builder dialog box."
So now I have to figure out how to make the text in the sketch equal to a formula in Driveworks.
Re: Convert Number to Letter?
MJuric wrote: ↑Tue May 04, 2021 10:27 am Quick Google http://help.solidworks.com/2018/english ... xpress.htm
"You can enter standard Microsoft™ Excel functions directly into the DriveWorksXpress Rule Builder dialog box."
So now I have to figure out how to make the text in the sketch equal to a formula in Driveworks.
- AlexLachance
- Posts: 2179
- Joined: Thu Mar 11, 2021 8:14 am
- Location: Quebec
- x 2361
- x 2011
Re: Convert Number to Letter?
Are you looking for it to automatically drive itself? Library Feature could sort of do what you want, but not "automate" the switch from letter to numbers, that would be done manually in by editing the feature, similarly like you would with a weldment.
Also, Library feature might not be the best option, if you have all the letters and numbers accordingly, the library feature would become rather "heavy"
Also, Library feature might not be the best option, if you have all the letters and numbers accordingly, the library feature would become rather "heavy"
Re: Convert Number to Letter?
I don't know if you can take anything away from this (character & number codes)
You miss 100% of the shots you don't take - Wayne Gretzky
Re: Convert Number to Letter?
Yes.AlexLachance wrote: ↑Tue May 04, 2021 12:57 pm Are you looking for it to automatically drive itself?
The numbers are done by a nifty thing I found in the old forum. In your sketch you draw the line for the text and another line. You dimension that line and make it the length of the amount you want the increment to be. So 1,2,3,4 you would draw a 1 inch line. For .5,1,1.5 you would draw a .5 inch line. Make your cut. Then when you array the sketch you link the "Instance Vary" option in the array to the dimension dimensioning the line. I then tied the number to array to the number in the actual hole pattern. So now I can enter the hole pattern and the marking text automagically creates the right amount of markings and the right sequence.
- jcapriotti
- Posts: 1862
- Joined: Wed Mar 10, 2021 6:39 pm
- Location: The south
- x 1202
- x 1992
Re: Convert Number to Letter?
That is a nifty trick. however you are getting onto a realm that may require the API to configure it. Our products have similar requirements and complexity and SolidWorks just can't do it OOTB. Driveworks (Full) may be able to do this, although it maybe custom there as well, not sure. We would do something like this with the API as a dynamically inserted library feature.MJuric wrote: ↑Tue May 04, 2021 2:32 pm Yes.
The numbers are done by a nifty thing I found in the old forum. In your sketch you draw the line for the text and another line. You dimension that line and make it the length of the amount you want the increment to be. So 1,2,3,4 you would draw a 1 inch line. For .5,1,1.5 you would draw a .5 inch line. Make your cut. Then when you array the sketch you link the "Instance Vary" option in the array to the dimension dimensioning the line. I then tied the number to array to the number in the actual hole pattern. So now I can enter the hole pattern and the marking text automagically creates the right amount of markings and the right sequence.
image.png
image.png
Jason
Re: Convert Number to Letter?
Sorry for reviving this age long thread... just stumble across this while i am trying to figure out how to convert A to 01 in Solidworks without involving macro or drivework..
Interestingly, using a design table seems to work...
Basically the design table is just to use excel equation as the equation capability in solidworks is really limited
(To convert number to letter, you will be using char() instead)
However, the design table need to be updated everytime the number/letter change...
Custom property Design table
Interestingly, using a design table seems to work...
Basically the design table is just to use excel equation as the equation capability in solidworks is really limited
(To convert number to letter, you will be using char() instead)
However, the design table need to be updated everytime the number/letter change...
Custom property Design table
Far too many items in the world are designed, constructed and foisted upon us with no understanding-or even care-for how we will use them.