AutoCAD Inventor :: VBA Script For Editing Title Block In IDW Files

May 3, 2012

I've been looking for a while and managed to find 2 VBA scripts for replacing values in a title block. However one errors out on the line that is supposed to do the replacing and the other works off an ID number which isn't consistent.

I'm a proficient scripter but not in this language, so how these scripts are working but not the intricacies of them. Which Is exactly what I think is needed to get either of them working.
 
Function Test_UpdateTitleBlock()Dim oDoc As DrawingDocumentSet oDoc = ThisApplication.ActiveDocumentDim oTitleBlock As TitleBlockDim oTextBox As TextBoxDim oSheet As SheetFor Each oSheet In oDoc.Sheets Set oTitleBlock = oSheet.TitleBlock For Each oTextBox In oTitleBlock.Definition.Sketch.TextBoxes If oTextBox.Text = "<FILENAME AND PATH>" Then ' Errors here and doesn't replace text Call oTitleBlock.SetPromptResultText(oTextBox, "New Value") End If NextNextEnd Function

This throws an error on the line I have marked.
 
Function Remove_Filepath()Dim oDrawDoc As DrawingDocumentSet oDrawDoc = ThisApplication.ActiveDocument' Create the new title block defintion.Dim oTitleBlockDef As TitleBlockDefinitionSet oTitleBlockDef = oDrawDoc.ActiveSheet.TitleBlock.DefinitionDim oSketch As DrawingSketchCall oTitleBlockDef.Edit(oSketch)oSketch.TextBoxes.Item(20).Text = " "Call oTitleBlockDef.ExitEditEnd Function 

This one works great, except that it does a "dumb" replace because it looks for the Xth textbox and edits that. The problem is in a detail drawing I want to edit textbox 20 but in assembly drawings I don't want to edit any textbox. So how to get this to loop through the textboxes and compare the text to what I want to replace.

View 1 Replies


ADVERTISEMENT

AutoCad :: Editing Title Block Using Block Editor

Aug 31, 2011

I'm editing a title block using the Block Editor. Unfortunatelly after closing the block editor the linse & Polylines reflect the changes apported in nodel space, but the text did not mouve?

View 2 Replies View Related

AutoCad :: Editing Text In Title Block In 2012?

Jan 2, 2012

I been working through Ellen Finklesteins AutoCad bible (using AutoCad Architecture 2012) and in the first exercise (quick start, drawing a window) I was going ok until I had to edit the title block and no matter what I tried in AutoCad Architecture 2012 I could not find a way to edit the title block. Maybe I should have bought a book that was specific to AutoCad Architecture 2012.

View 8 Replies View Related

AutoCAD Inventor :: Retaining Title Block Prompted Entries When Changing Title Blocks

Apr 26, 2013

The title blocks that we use have prompted entries in them and I would like to find a way using iLogic to copy the entries from one title block to another within the same drawing; i.e.. if the user decides to change from an A2 to A1 drawing.

I already have an iLogic rule which allows the user to change the active border, title block and sheet size based on a form selection but would like it to capture the prompted entries already entered and re-use them after the change.

View 9 Replies View Related

AutoCAD 2013 :: Editing Architectural Title Block - Cannot Insert Into Drawing

Mar 5, 2013

I'm trying to edit an architectural Title Block. I've went into block editor and did attribute definitions. However, when I save it I can't insert it into a drawing. Is there anything I can do to prevent this from happening?

View 2 Replies View Related

Revit :: Title Block Family - Editing Text On Project

Nov 22, 2011

I've created a Title Block Family and when I bring it into the project I want to be able to edit the text on the project without having to go into the Family and edit it from there, how do I do this?

View 2 Replies View Related

AutoCad 2D :: Keyword Search Within Files / Title Block?

Sep 4, 2013

how to search for keywords within autocad file? word in title block, I got alot of DWG files inside the Hard drive, my co worker was asking me to plot out one of the drawing, don't know the drawing number but only know the date/mo/years was created, and the words inside the file. i typed in the window explorer as shown below but found none. sometime it's very difficult to look for the certain drawing when someone named by number and letter, i like to name the cad drawing with good description and then i put the dwg # or Pro# in the title block.

View 9 Replies View Related

AutoCAD Inventor :: New Title Block In Old Drawings?

Oct 22, 2013

I have done a new Title Block in our drawing templates.

It only works in New drawings if I open an old drawing I must "Copy/paste" the new Title Block into the browser to the left But I want all our old drawings to use the new Title Block.

Is there a way to have the new Title as default on all old drawings?

View 3 Replies View Related

AutoCAD Inventor :: Customizing The Title Block?

Jun 14, 2012

How can I customize the title block where it says Drawn, Checked and approved?

I want the dates with initials to place automatically. However, I want the date of approval and checked to be 2-5 days after the drawn date. (using Inventor pro. 2012)

View 1 Replies View Related

AutoCAD Inventor :: Replace Title Block C#

Oct 2, 2013

I am trying to replace the title block of the first sheet of the active drawing via C#. I currently am receiving the following error on the last line of The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)).

Why the code below is throwing this error? I have tried multiple variations of the code below to no avail and I'm sure this is something minor that I am overlooking. The title block definition under Drawing Resources is replaced with no errors, the title block on Sheet 1 is deleted just fine, but I can't seem to add a Title Block back in!

How Documents are defined:

Inventor._DrawingDocument oDoc = getDoc();Inventor.DrawingDocument sourceDoc =(Drawing Document) instance.Documents. OpenWith Options(sPath, options, false); Find, copy, replace: TitleBlockDefinition tBlock = sourceDoc.TitleBlockDefinitions[blockList.SelectedItem.ToString()]; TitleBlockDefinition newBlock = tBlock.CopyTo(oDoc, true); oDoc.Sheets[1].TitleBlock.Delete(); oDoc.Sheets[1].AddTitleBlock(newBlock);

View 1 Replies View Related

AutoCAD Inventor :: Weight In BOM / Title Block

Apr 20, 2012

I am trying to include the weight for all components in assembly BOM as well as calculated overall weight in TB, but there are no available property to choose from in the drop-down list.

View 2 Replies View Related

AutoCAD Inventor :: Get Parameter Into Title Block?

Apr 10, 2013

I've created the user parameters and they get the information I need by the rules in illogic and also added as custom properties, but when I try to put them on the title block they don't retrieve the information.

View 9 Replies View Related

AutoCAD Inventor :: Get Parameter Into Title Block (CF)

Apr 10, 2013

I've created the user parameters and they get the information I need by the rules in illogic and also added as custom properties, but when I try to put them on the title block they don't retrieve the information.

View 1 Replies View Related

AutoCAD Inventor :: Mass In Title Block

Nov 26, 2012

I have added the mass properties and I do not want the lbmass behind it. How do I get rid of it?

View 5 Replies View Related

AutoCAD Inventor :: Title Block Macro

Jun 13, 2013

Malfunctioning Title Block Macro in Inventor 2014? The script is attached. I think there is a problem with datums. I have switched to a new computer and installed Inventor 2014 on it. The macro worked with my old computer and Inventor 2013. This is a .ivb-file, not a .txt-file. Please change that before you test it.

View 8 Replies View Related

AutoCAD Inventor :: Custom Title Block

Mar 28, 2013

I have a cutom title block that automaticly places material, status, stock number etc. of the component in the drawing sheet, but I am stumped as to placing the quantity automatically. I have defaulted to using a prompted entry, but that is prone to errors.

View 9 Replies View Related

AutoCAD Inventor :: Title Block Reference?

Apr 5, 2012

I have text in my title block that references part properties. If I have several different part and assembly base views on a sheet, how do I control which one the title block references? It defaults to the first one that was placed. I am using 2011 Pro.

View 1 Replies View Related

AutoCAD Inventor :: Drawing Add In Title Block?

Jan 22, 2013

Is there an add in or something for faster type in the title block in a drawing? Name, title etc?

 Right now the author and date are automatically  but when i save the file to for example to "D1234 hammer" it becomes the part number.

I have to edit the title.

I want to save the file to "D1234 hammer" and the partnumber to be "D1234" and title "hammer".

IS there a add-in that I type the title and name and its auto fill the title block? Or do I have to create a custom title block so the drawing can understand to only to take the numbers from <part name> and the letters becomes <title>?

View 3 Replies View Related

AutoCAD Inventor :: How To Get New Title Block Into Old Drawing

Aug 17, 2012

We are going to be making a new title block and I have been looking at ways to get the new title block into the old drawings.  It looks like the Inventor Drawing and Resource Wizard is the way to go.

The steps seem pretty straight forward and simple but I am not getting the correct results.  For the source drawing I select my new title block and leave the boxes for borders, my new title block name, and sketched symbols checked.  I then pick my drawing I want to get the new title block in.  On the last step I can select Yes or No and get the same results.  When I reopen Inventor and the drawing it still has the old title block in it.

View 4 Replies View Related

AutoCAD Inventor :: Change A Title Block?

Mar 26, 2013

Is there a way to change a title block? After finishing all the dimensioning and details I realized I used the wrong title block.

View 3 Replies View Related

AutoCAD Inventor :: Two Different Border And Title Block Colors

Feb 5, 2013

I use two different measuring system IMPERIAL and METRIC.

What I want is to be able tell at a glance, by having different color border and Title-block Text  is which one of the system of units I'm using

So what I'm wanting to do is create a Metric Sheet template with on color, Border, Title Block Text and a different color for the Imperial.

I've tried changing the color using the Style Center but that affects both templates, I've tried editing the title-block text saving the template but on opening it has changed back to the defaults set in the style settings and dose not hold those that I set.

What I don't what to be doing is changing them after opening, as at some stage I'll forget.

View 3 Replies View Related

AutoCAD Inventor :: Title Block - Copyright Year

Sep 28, 2012

So, I am trying to add a copyright year to a title block in a drawing template file used through out my company. I want to base the year off of the creation date property - I am trying to find a way to truncate this property such that only the year is displayed. Ideally, any time the creation date property is changed, the copyright year will also update.

We are currently running Inventor 2010.Normally, I would just write an iLogic rule with an event trigger, but this would require everyone to install the iLogic addin which just won't happen.

Even easier, I could make a custom iProperty and just have people manually type in the year when they start a new drawing - this will be worst case scenario as a ton of people will forget and I'll just make more work for myself.I also have VBA code which is pretty simple:

Public Sub SetYear()
Dim oDoc As Document    
Set oDoc = ThisApplication.ActiveDocument      
Dim customPropSet, customPropSet2 As PropertySet    
Set customPropSet2 = oDoc.PropertySets.Item("Design Tracking Properties")    
   
[code]....

The issue would be getting this VBA code to trigger and to "stick" to the template file.I can just as easily write this code in VB.NET or C#, and go through the hassle of creating an add-in, but again, how would I get it to trigger and stick to the template file.

View 3 Replies View Related

AutoCAD Inventor :: Customize Title Block Created In IDW

Jun 26, 2013

I have a customized title block that I created in an idw.  I want to make that block available for all drawings for different projects.  How do I do that?

View 3 Replies View Related

AutoCAD Inventor :: ILogic Title Block Customization

Jun 26, 2013

Earlier I`ve used a simple code from Rob Cohee to update the title blocks and it works like a charm, however, now I would like to try to kick it up a notch.

If (ThisDrawing.ModelDocument Is Nothing) Then ReturnmodelName = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)iProperties.Value("Project", "Part Number") = iProperties.Value(modelName, "Project", "Part Number")iProperties.Value("Custom", "Client") = iProperties.Value(modelName, "Custom", "Client")

I`m working with several similar projects where the Inventor models and IDW`s is copied from one project to another. A typical project can consist of 50-75 drawings and the only properties needed to change is Client, project number and drawing number (consisting of the project number and a suffix, ex 123456789-125).

I would like to try to make an .ini file with these 3 properties in the root of the project folder so they can be changed and updated easily.

View 3 Replies View Related

AutoCAD Inventor :: Unit Display In Title Block

Apr 23, 2013

Below is a code I managed to scramble together to display the unit used in the drawing template. The units are selected once the drawing is opened based the Standards ANSI and ANSI-mm from the styles library.

The code displays the units used in template as a custom iproperty called "drawingUNITS". This code works great however, I would like it if possible to be more clearer to the shop guys looking at the drawings.

I would the result to be

ANSI = Imperial (or inches) and ANSI-mm = Metric

is there somewhere in the code provided that I can get my desired result?
 
' To use this rule, create a Text parameter named Standard in the drawing.' Assign it values such as:

' ANSI' ANSI-mmdoc = ThisDoc.DocumentcustomPropertySet = doc.PropertySets.Item("Inventor User Defined Properties") 'Make sure drawingUNITS property existsTry prop = customPropertySet.Item("drawingUNITS")Catch 'Assume error means not found customPropertySet.Add("", "drawingUNITS")End TryDim drawingDoc as DrawingDocument = ThisDoc.DocumentFor Each standardX In [code].......

View 1 Replies View Related

AutoCAD Inventor :: Custom Title Block Position?

Jun 19, 2012

I have created a custom title block and border for one of the automotive manufacturers since I need to submit all their drawings in the standard border and title block format. The border is quite broad, so when I insert the new title block, it overlaps the border slightly. I need to try and find the setting to control the exact point at which the title block is positioned when inserted into a drawing.

Windows 7 Pro (X64)
Intel(R) core (TM) i7-2600 CPU @ 3.40GHz
16.0 GB RAM
Nvidia Quadro 600
Autodesk Inventor 2013 Professional Ultimate Design Suite

View 4 Replies View Related

AutoCAD Inventor :: Title Block - Material Field

Aug 29, 2012

I am using 2013 Inventor.My company uses the .dwg file extension instead of .idw (if that makes a difference).When I make a new .dwg file and insert an .ipt file for my first base drawing ..The material field of the .dwg Title Block is populated.This is something I would like to avoid.When I open iProps in the .ipt drawing and go to the Physical/Material Tab don’t seem to have the option to display a blank (no information) in the material field in the Title Block.The closest I can come to this is to choose Generic, which looks kind of odd.

My company chooses to give all material specs in a note displayed on the drawing.In case of a material change at some point, I do NOT want to have to change the note on the drawing AS WELL AS the Material information in the .ipt iProps.The reason is that, sooner or later, I’ll forget to change both(which will lead to confusion) and possibility lead to making junk parts (made of the wrong material) which will then have to be thrown away (at perhaps a major loss).

View 2 Replies View Related

AutoCAD Inventor :: Custom Title Block Information

Feb 13, 2013

I've argued this repeatedly with the powers that be at my small company and they're set on some old methods that I'm trying to figure out how to make happen.

We often have weldments where we do an assembled view on page 1 and balloon it and have a parts list. Pages 2-4 will be the details of the welded parts. On page 1, I bring in the "Title" and "Subject" fields from the assembly iProperties.

Here's the tricky part. On pages 2+, I don't want to bring in those two fields, I want to bring in something different. Is it possible to differentiate like that?

Second part of the question: is there a way to pull the balloon item number from page 1 into a field somewhere on following pages? For example: page 3 may show the details for "item 2". Can I bring the value of that balloon (item 2) into page 3 somehow?

View 3 Replies View Related

AutoCAD Inventor :: Title Block Drawing Number?

Jan 9, 2014

I am trying put drawing numbers on my drawings.  The drawing number is "019-02-00038-x" where "x" is the page number in the set of drawings.  How do I set this up?  Every time I try to change "x" it changes it for the entire set of drawings. 

I'm working with Inventor 2014.

View 1 Replies View Related

AutoCAD Inventor :: Customized Title Block With Graphic?

Jan 9, 2013

I've customized the title-block template by changing a few of the default texts and by adding a graphic image.I know from other post here that when the new template is created and then used the graphic needs to have pointer set etc set a the time of creation of the new template, I've done all that and it works fine.

However there are two points :-

1) When a new drawing created with my template then saved as a IDW is the graphic image then embedded in that IDW or referenced each time the file is opened?

2) If I upload these IDW files, as created as above to a web site or transfer to another machine do I need that template file and image to be on that other machine  and/or do I need to upload the template and graphic graphic files with that/those IDW, IPT, IAM files so that when some one else opens these IDW files that graphic is displayed?

Inventor 2013 Pro

View 5 Replies View Related

AutoCAD Inventor :: View Scale In Title-block?

Sep 16, 2011

I am trying to get the scale of the base view in my titleblock. I have searched, the conclusion that as of Inventor 2012, this still can not be accomplished without add-ons?

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved