Have an Excel spreadsheet control the iProperties Title Block text via iLogic steps.

Have an Excel spreadsheet control the iProperties Title Block text via iLogic steps.

chrisccorbett
Explorer Explorer
494 Views
5 Replies
Message 1 of 6

Have an Excel spreadsheet control the iProperties Title Block text via iLogic steps.

chrisccorbett
Explorer
Explorer

I would like to have an Excel spreadsheet control the iProperties Title Block text via iLogic so I can just update the linked Excel spreadsheet to all common .idw drawings.  The reason is I have 250+ drawings that will never change, but the Title Block info will with every new job. Is there a good step by step way to do this in iLogic? Thanks, Chris

0 Likes
Accepted solutions (1)
495 Views
5 Replies
Replies (5)
Message 2 of 6

WCrihfield
Mentor
Mentor

Hi @chrisccorbett.  Just some process thoughts...

If you only want the Excel data to effect the drawing, and not the model it is referencing, then what I would do is allow the drawing's title block text boxes to be pointing to the drawing's own iProperties, then use an iLogic routine that will pull data from the Excel sheet, and set that data as the value(s) of the drawing's iProperties.  Then just do a Sheet.Update, and/or DrawingDocument.Update to make the title block data update to show the new iProperty values.  The above process would be much simpler/easier than using 'static' text in the title block, and trying to dig down into the title block definition's sketch and loop TextBoxes, trying to find the right ones to change the values to the right corresponding values.

How are your drawings' title blocks currently set-up...with static values, pointing to model iProperties, pointing to drawing iProperties, or something else?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 6

chrisccorbett
Explorer
Explorer
Hi, I agree with that process you outlined because all the Title Block Data is iProperties controlled already for our drawings, but how do you do that step by step process to link an excel spreadsheet to the iProperties fields because I am not iLogic savvy? Is there any videos that I can learn from?
0 Likes
Message 4 of 6

WCrihfield
Mentor
Mentor

Hi @chrisccorbett.  I may not have time today to explain everything you would need to know today, but you can not actually 'link' your iProperties directly to an Excel value, and you can not 'link' a title block textbox directly to an Excel value.  There are ways to link Parameters directly to an Excel file though.  And you can set a certain property of numerical Parameters (will not work for Text or Boolean type parameters) so that it will automatically generate an identically named custom iProperty, and keep that iProperty's value updated to reflect the value of the parameter.  Then, if your TextBox within your TitleBlock is set-up to be 'linked' to that iProperty, it can seem like it is 'linked' to the Excel file.  If any of the Excel values are Text or Boolean (True/False) data type, then those values will not remain 'linked' and automatically updated, like the numeric values would, and other slightly more complex steps would be needed in an attempt to keep the values updated.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 6

chrisccorbett
Explorer
Explorer
Hi, this is what I want to do by disagreeing with your statement above because you are not actually reading my original post question:

"Link an excel spreadsheet to an iProperties thru the use of iLogic" (Main Subject Post). I know you can do this because I have read other forum questions pertaining to this link by other experts, but nothing comes about the step by step to do that. You keep over scanning my original post when I am talking about this subject, if you don't have time to post an actual answer to my actual post question, then why post something? Please see my Avatar Image, LOL. Thanks for your help.
0 Likes
Message 6 of 6

tyler.warner
Advocate
Advocate
Accepted solution

Here is a way to update your iProperties with an Excel document.

 

Dim oDrawingDocument As DrawingDocument = ThisApplication.ActiveDocument
Dim oProjectPropertySet As Inventor.PropertySet
Dim oCustomPropertySet As Inventor.PropertySet

Dim oDescriptionProperty As Inventor.Property
Dim oCustomProperty As Inventor.Property

oProjectPropertySet = oDrawingDocument.PropertySets.Item("Design Tracking Properties") ' PropertiesForDesignTrackingPropertiesEnum 
oDescriptionProperty = oProjectPropertySet.Item("Description") ' kDescriptionDesignTrackingProperties
oDescriptionProperty.Value = GoExcel.CellValue("C:\temp\ExcelBook1.xlsx", "Sheet1", "A1")

oCustomPropertySet = oDrawingDocument.PropertySets.Item("Inventor User Defined Properties") ' PropertiesForUserDefinedPropertiesEnum 
oCustomProperty = oCustomPropertySet.Item("myCustomProp")
oCustomProperty.Value = GoExcel.CellValue("C:\temp\ExcelBook1.xlsx", "Sheet1", "A2")

 

If this solved your problem or answered your question, please click ACCEPT SOLUTION.
If this helped you, please click LIKE.
0 Likes