Inventor General

Reply
*cbliss
Message 11 of 13 (1,182 Views)

Re: Deleting Title Block

08-27-2004 06:46 AM in reply to: *Kirk A.
However, if you copy a sheet from one drawing into another and they both have title block definitions of the same name, it uses the current one. This causes a bit of a problem if the goal is to update the title block definition. Also in the API, I have not found a way or renaming the title block definitions so that if there is a name conflict, you can change the existing one and have both the old and new names. To make it even more convoluted, you cannot delete Sheet Format via the API hence if you wanted to "rename" or update title block definitions by deleting and replacing them, you can't do it because the sheet format will not let the Title Block definitions be deleted. Not hard to guess what I am trying to write. Chris Palmatier [Autodesk] wrote: >For what it's worth, in r9, if you copy a title block from one file and >paste it into another file with a title block of the same name (right-click >on Drawing Resources > Title Blocks node), you are prompted to redefine or >munge the name (not the exact prompt :smileywink:. > >This only works for title blocks at this point. > > >
Contributor
Posts: 13
Registered: ‎08-28-2008
Message 12 of 13 (1,140 Views)

Re: Deleting Title Block

05-27-2011 09:08 AM in reply to: *cbliss

Is there anyway of automating the deletion of a title block?

I went and changed about 300 drawings from "ABC" title block to "XYZ".

I would now like to delete "ABC" title block from all those drawings.

(I know, I should have done this when I inserted "XYZ" title block,  but it's water under the bridge.)

 

Using Inventor 2012

 

TIA,

Ken -

Mentor
Posts: 183
Registered: ‎09-23-2008
Message 13 of 13 (1,115 Views)

Re: Deleting Title Block

05-27-2011 11:49 AM in reply to: kschumacher

I don't have Inv. 2012, so there may be a better way.

Here's a little macro I tried in Inv. 2010.

You could use the macro with Kent's KWiKBatchRun which you can find at

http://www.kwikmcad.com/icode/32bit/32BitAddins.aspx

 

Mike

 

Public Sub Delete_ABC()
    ' Set a reference to the drawing document.
    ' This assumes a drawing document is active.
    Dim oDrawDoc As DrawingDocument
    Set oDrawDoc = ThisApplication.ActiveDocument
    oDrawDoc.Update
   
    ' Obtain a reference to the desired Title Block definition.
    Dim oTitleBlockDef As TitleBlockDefinition
    Set oTitleBlockDef = oDrawDoc.TitleBlockDefinitions.Item("XYZ")
   
   
    ' Set a reference to count all sheets in document
    Dim oSheets As Sheets
    Set oSheets = oDrawDoc.Sheets
   
    Dim iSheets As Integer
    For iSheets = 1 To oSheets.Count

    ' Check to see if the sheet already has a Title Block and delete it if it does.
    If Not oSheets(iSheets).TitleBlock Is Nothing Then
        oSheets(iSheets).TitleBlock.Delete
    End If
 
    Next
   
    ' Delete the Title Block from the document
    oTitleBlockDef.Delete
   
    End Sub

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube