edit TitleBlock

edit TitleBlock

Ralf_Krieg
Advisor Advisor
599 Views
4 Replies
Message 1 of 5

edit TitleBlock

Ralf_Krieg
Advisor
Advisor

Hello

 

I'm trying to edit the titleblockdefinition "test" (the third definition in list) in my drawing, but the code below always opens the first titleblockdefinition in the list of drawing resources. Where's my mistake?

 

Private Sub changetitleblocktext()

Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oTitleBlock As TitleBlockDefinition
Set oTitleBlock = oDoc.TitleBlockDefinitions.Item("test")

Dim oSketch As DrawingSketch
Call oTitleBlock.Edit(oSketch)

'.......

Call oTitleBlock.ExitEdit(True)
End Sub


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
600 Views
4 Replies
Replies (4)
Message 2 of 5

PolemEngineering
Advocate
Advocate

I'm not sure, but maybe you can try to replace "test" in your code into a number.

Set oTitleBlock = oDoc.TitleBlockDefinitions.Item(3)

 

A few months ago I get this piece of code from another forum-member. The 1 indicates the first textbox in the first sketch.

 

ThisDocument.ComponentDefinition.Sketches(1).TextBoxes(1).Text _
= ThisDocument.PropertySets("Inventor User Defined Properties").Item("txt").Value

 Maybe it works for you.

 

René

René van der Starre

0 Likes
Message 3 of 5

Ralf_Krieg
Advisor
Advisor

Hello

 

Unfortunately, Item(3) also opens Item(1) for edit.


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 4 of 5

YuhanZhang
Autodesk
Autodesk

Can you attach a document for reproduce this issue? And tell which Inventor you are using?



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 5 of 5

Ralf_Krieg
Advisor
Advisor

Hello

 

I'm using Inventor Suite 2011.

I tried really hard this morning to get the error again - no way. Everything works as expected. 🙂

Don't know why, but it seems the mistake was somewhere between my ears.

 

Thanks to all for help.


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes