Hello All,
Hope this is the correct location to post this.
I have what seems to be an easy question but the answer is eluding me.
I have 2 drawing numbers in a document (.idw) a company drawing number & a client drawing number.
Both need to reference the sheet number within the drawing number.
The problem I'm having is our company number needs to read XXX.1 (1 being the sheet number) but the client number needs to read XXX.001 (001 being the sheet number)
I haven't been able to find where I can change the format of this property either in inventor properties or iLogic.
Also is it possible to have to different formats of the same referenced property within the same document (.idw)?
Any help would be much appreciated.
Please feel free to ask questions if I haven't provided enough information
Kind Regards
Tim
In ilogic you do this:
SyntaxEditor Code Snippet
Dim oString As String = 0 Dim oDouble As Double = 1 oString = Microsoft.VisualBasic.Strings.Format(oDouble,"00#") MsgBox(oString)
So the message box will return 001
I hope that helps
That's how you create leading zeroes, but it doesn't access the sheet number. I may be missing something, but I've found the sheet number to be hard to access.
Over in the drawing browser tree, the "Title:1" and "Sheet:2" are the Sheet.Names, but I can't find the iLogic or API magic that gets just the number of the sheet.
>>>>more code before<<<<
Dim oParentViewSheetName As String oParentViewSheetName = oParentViewSheet.Name Dim oParentViewSheetIndex As String Dim oColonIndex As Integer oColonIndex = oParentViewSheetName.IndexOf(":") Dim oParentViewSheetNameLength As Integer oParentViewSheetNameLength = Len(oParentViewSheetName) oParentViewSheetIndex = Right(oParentViewSheetName, oParentViewSheetNameLength-oColonIndex-1)
BrandonBG
Inventor 2015
I don't think he is trying to actually change the format of the sheet number, just generate a part number that includes the sheet number.
You are correct.
My code is not the solution, but it shows how I grab the sheet number. He does need to access the sheet number to rename the part.
BrandonBG
Inventor 2015
Thanks for your response guys,
My apologies for not explaining thourougly.
In short DRLTKSE I am trying to format the sheet number.
It is just that sheet number/property is referenced in 2 locations/drawing numbers a company & a client (please see attached)
They both reference the inventor Sheet Property - Sheet Number & the format is currently to a sinlge digit (eg .1 , .10) which is required for our company document. Im trying to customize the Client document sheet number to 3 digits (eg .001 , .010) which is required by our client
If managed to get the active sheet number using the following code if it helps, but I haven't been able to format it
Also I then only need the formatted number to update the client document number only, which is contained within a sketch symbol
Hope this explains it a bit better & many thanks in advance for your help.
If you have any further questions please feel free to ask
Kind Regards
Tim
Just thought I would add that both the Company & the Client document number are in the same drawing (.idw)
Tim
We just had a discussion here about using a different format for Sheet Numbers that is more in line with architectural drawings (A1.1 A1.2 etc.).
I think the solution is to create a parameter that acts as the modified sheet number. Then, pull that into the part name. I don't think the Sheet Number can be modified itself.
BrandonBG
Inventor 2015
I agree with BrandonBG, you need to create a custom property derived from the sheet number and then format it the way you want.
Actually it's a bit more complicated than that. If you make a custom iproperty it would update the sketched symbol on every sheet to show the number of the current sheet.
You could just make a prefix of 00<sheet Number> but then sheet 10 would be XXXX.0010 and I imagine you want XXXX.010
Yeah I had that same idea Brandon
I used the following code to get the sheet number of the active sheet & set my custom parameter
oDoc = ThisDoc.Document SheetNumber = Mid(oDoc.ActiveSheet.Name, InStr(1, oDoc.ActiveSheet.Name, ":") + 1) MessageBox.Show(SheetNumber, oDoc.ActiveSheet.Name) Parameter("Sheet_Number") = SheetNumber
MessageBox.Show(CStr(Format(Sheet_Number, "000")))
Argument not specified for parameter 'format' of 'Public Shared Function Format(enumType As System.Type, value As Object, format As String) As String'.
I cant seem to figure out how to format the custom parameter.
Also how would I get the code to search through all sheets for relevant sketch symbol update the custom parameter then update it in each sheet?
Scratching my head as well to what would be code triggers for if I add or delete sheets or reorder them.
Any idea's?
Tim
Digging up an old one, but was a working solution discovered?
I need to do a similar thing but also need to set a starting number
Just a quick FYI: In Inventor 2024, you can now drop the 'Sheet Name' directly into the 'Format Text' dialog, from the drop-down options. That was one of the new abilities.
Text Enhancements (What's New in 2024)
Beyond that, the Sheet Number property that you can drop into the Format Text dialog, does not seem to be mentioned in the official FormattedText online help page, so using a PromptedEntry, as the previous poster mentioned is still likely among the best options available today, even though they may seem to be a bit of a pain to deal with at times.
Wesley Crihfield
(Not an Autodesk Employee)
Can't find what you're looking for? Ask the community or share your knowledge.