Writing drawing Prompted Entries to Excel

Writing drawing Prompted Entries to Excel

H4TSDESQ
Enthusiast Enthusiast
1,299 Views
23 Replies
Message 1 of 24

Writing drawing Prompted Entries to Excel

H4TSDESQ
Enthusiast
Enthusiast

Hey All.. 

I'm looking for a more automated way of taking some Prompted Entry values when a sheet is created and having it exported out to an Excel file. Currently we have to have someone manually copy the info here into an excel file.

H4TSDESQ_0-1734544649667.png

 

I came across this post which can do the inverse (writes data to those fields).

From the Trenches with Autodesk Inventor: iLogic - TitleBlock Project Data From Excel

 

Could someone point me in the right direction?

0 Likes
Accepted solutions (1)
1,300 Views
23 Replies
Replies (23)
Message 21 of 24

dlongley
Enthusiast
Enthusiast

I was about to try this, but realised that I use a Sketch Symbol for my titleblock text, rather than using the Field Text of the Titleblock.  This allows me to use shared data (iProperties) that are the same on every sheet in the drawing (say Part Number = Drawing Number, Title Lines 1 - 3, etc) , but also have unique info (such as Title Lines 4-5, drawn by, etc) which will be different on each sheet.  So that particular Sketch Symbol has a mix of iProperties and Propmpted Entries.

 

How does one go about extracting the various Field Text for a Sketch Symbol?

 

Thanks.

0 Likes
Message 22 of 24

dlongley
Enthusiast
Enthusiast

Sorry, meant to also mention that I use some of the Sheet properties, such as Sheet Name and Sheet Revision in my sketch symbol.

0 Likes
Message 23 of 24

C_Haines_ENG
Collaborator
Collaborator

You can use something like this to get the data from a sketched symbol. However, if its just referencing data from a model it would be easier to get the values from the model.

Sub Main
	
	Dim oSymbol As SketchedSymbol = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingSketchedSymbolFilter, "Select Sketch Symbol")
	
	Dim oSketch As DrawingSketch = oSymbol.Definition.Sketch
	
	Dim oText As String = oSymbol.GetResultText(oSketch.TextBoxes(1))
	MsgBox(oText)

End Sub
0 Likes
Message 24 of 24

dlongley
Enthusiast
Enthusiast

I can see how that grabbed the data that appears in the first text box.  This happens to be made up of "<Part Number>_<Sheet Number>" to give a Drawing Number of the form "123456_0002".  In order to make sense of the data extraction, it needs to have the Name of field, along with field text.

 

Is that possible?

0 Likes