Hello Community,
Is it possible to use a drawing as a reference with the title block fill-out with correct data used to automate the title block on different drawings. I am using Inventor Professional 2023.
Drawing1.dwg to be the reference drawing.
Title block: DANNYBOY
FIELD TEXT: <CUSTOMER> VALUE <CUSTOMER LOCATION> VALUE <TITLE> VALUE ….
Other drawing: Drawing2.dwg
I create this rule to bring in the title block, but still need more direction to bringing in the data with the title block.
ThisDrawing.ResourceFileName = "Drawing1.dwg" ThisDrawing.KeepExtraResources = True ActiveSheet.TitleBlock = "DANNYBOY"
Thank you for your support
It looks like your using prompted entry in the title block. I would advise you to change that to iproperty entries as it gets difficult to handle the prompted entry by code.
If you cannot remove the prompted entry you will need to add the prompted entry contents at the same time as you are adding the titleblock. Here is the link to the API sample.
This is where the prompts are added. It starts at 0 and ends at the number you need.
Dim sPromptStrings(1) As String
sPromptStrings(0) = "String 1"
sPromptStrings(1) = "String 2"
The below code is an extract of the InsertTitleBlockOnSheet sub routine and is converted from VBA to ilogic/vb.net . I have added in the border addition as well.
' Set a reference to the drawing document. ' This assumes a drawing document is active. Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument ' Obtain a reference to the desired border defintion. Dim oTitleBlockDef As TitleBlockDefinition oTitleBlockDef = oDrawDoc.TitleBlockDefinitions.Item("DANNYBOY") Dim oSheet As Sheet oSheet = oDrawDoc.ActiveSheet ' Check to see if the sheet already has a title block and delete it if it does. If Not oSheet.TitleBlock Is Nothing Then oSheet.TitleBlock.Delete End If ' This title block definition contains one prompted string input. An array ' must be input that contains the strings for the prompted strings. Dim sPromptStrings(1) As String sPromptStrings(0) = "String 1" sPromptStrings(1) = "String 2" ' Add an instance of the title block definition to the sheet. Dim oTitleBlock As TitleBlock oTitleBlock = oSheet.AddTitleBlock(oTitleBlockDef, , sPromptStrings) ' Check to see if the sheet already has a border and delete it if it does. If Not oSheet.Border Is Nothing Then oSheet.Border.Delete End If 'Obtain a reference to the desired border defintion. Dim oBorderDef As BorderDefinition oBorderDef = oDrawDoc.BorderDefinitions.Item("11x17") ' Add the border to the sheet. Dim oBorder As Border oBorder = oSheet.AddBorder(oBorderDef,)
Can't find what you're looking for? Ask the community or share your knowledge.