Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iProperty for the sheet revision number

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
2065 Views, 5 Replies

iProperty for the sheet revision number

Can anyone help me find the iProperty for the sheet rev #, It,s available in the sheet in the drop down under sheet properties, however I cant seem to find it in the iLogic Rule Editor

Example snippet from the routine:

SyntaxEditor Code Snippet

'get the revision number of the current document from the iproperties
oRevNum = iProperties.Value("Project", "Revision Number")
oSheet =  ActiveSheet.Sheet

This works fine for the "Project" rev# but I need the "Sheet" rev # 

5 REPLIES 5
Message 2 of 6
peter.hamas
in reply to: Anonymous

Hello,

 

If I understand correctly, you mean the revision property in the Edit Sheet dialog right?

2016_10_05_13_06_35_Edit_Sheet.png

if so, this property seems to be unavailable for the Inventor API (and also in iLogic since it also uses the API)

it should be in the Sheet object, there is for example the get_Orientation, get_ExcludeFromCount, get_ExcludeFromPrinting ...

but the revision is missing for some reason

 

~peter

Message 3 of 6
rhasell
in reply to: peter.hamas

Hi

 

I that case, are you able to move to single sheet drawings?

 

I personally find that the benefits of single sheet drawings far outweigh the benefits of multi sheet drawings. (I use 'non printable'/blank sheets, to pad my drawings, to simulate a multi sheet drawing.)

 

One use...

Snippet from my code to Attach the Rev to the PDF print.

------ snippet ----

oRevNum = iProperties.Value("Project", "Revision Number")

oDataMediumPDF.FileName =oFolder + "\" + oFileName & "[" & oRevNum & "]" & ".pdf"

---- End ----

 

Reg
2025.1.2
Please Accept as a solution / Kudos
Message 4 of 6
Anonymous
in reply to: rhasell

I agree but I am being pressured to use multiple sheet drawings by our drafting department who are writing this into their std. So a solution is still needed. thanks for your thoughts.

Message 5 of 6
rhasell
in reply to: Anonymous

Pity.

 

Good luck, I hope you get a working solution.

 

 

Reg
2025.1.2
Please Accept as a solution / Kudos
Message 6 of 6
ThomasSwanson
in reply to: rhasell

I would strongly push your drafting department not to use the sheet revision.   As you are finding out it isn't available to the API.   More importantly if you ever go to Vault you will not be able to map in this sheet revision to the Vault properties.

 

I am currently struggling with that now and having to hand edit over a thousand drawings to correct the old title block to look at the Inventor iproperty revision, and not the sheet property revision.

 

Here is a little code snippet that will look for a text box called <Sheet Revision> and then read the value in it and write it to a custom iproperty.  You will have to tweak it to write to that text box or by issuing a create command at a given X, Y coordinate you can make your own.

 

Dim oDrawDoc As Inventor.DrawingDocument = ThisApplication.ActiveDocument
ActiveSheet = ThisDrawing.Sheet("Sheet:1")
x = 1
Dim oTxtBox As Inventor.TextBox
Dim oRev As String
Dim oTitleblock As Inventor.TitleBlock = oDrawDoc.ActiveSheet.TitleBlock
    For Each oTxtBox In oDrawDoc.ActiveSheet.TitleBlock.Definition.Sketch.TextBoxes
        If oTxtBox.Text = "<Sheet Revision>" Then
		oRev=oTitleBlock.GetResultText(oTxtBox)
		iProperties.Value("Custom", "Sheet Revision")= oRev
		
		'MessageBox.Show("Found sheet Revision", oRev)
		

End If
        x += 1 
    Next
	

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report