AutoCAD .NET :: Swap Titleblock Between 2 Drawings
Feb 4, 2013
I have 2 files and I'd like to copy a titleblock from a template drawing and use it to replace an existing titleblock on an in progress drawing. The titleblock on the in progress drawing has attributes, and I'd like to keep them when I put in the new titleblock. The attribute tag names between the 2 titleblocks are the same.
I do not know the exact names of the titleblocks, only that they contain the words "title block" somewhere in their name.
I've developed for Inventor for a while now, but I'm completely new to AutoCAD. How might I go about this?
I believe the basic steps would be something like this:
1. Identify which object to copy from template sheet.
2. Save that object to memory
3. Identify object to replace in existing drawing
4. Copy attributes and get position of existing titleblock
5. Delete existing titleblock
6. Insert new titleblock and copy in attributes
I've taken the Autocad tutorials, and I've searched for relevant posts on ThroughTheInterface. Is there someplace else to look which might give a more in-depth example of what I'm trying to accomplish?
I have a drawing with 18 viewports, each one has (should have) a titleblock but xref manager tells me it is not found. Firstly, why would it now not be attached? And secondly, why am I not simply able to re-reference it? I tried to UNLOAD and DETACH it but it wont do it as there are multiple inserts. So I tried to RELOAD and ATTACH but no joy. It simply gives me the path to the referenced file (which is correct by the way) So, how do I reload the titleblock to each layout?
i've to list all layers and objects in the drawing. I've got 2 checkedlistbox, one for layers, the second for objects.I've got 2 buttons, one up, one down, for swaping order. I've no problem with objects, but it seems a little more complicated with layers.I use this code to swap:
Using tr As Transaction = db.TransactionManager.StartTransaction Dim id1 As ObjectId = listLayerID(CB_List_Layer.SelectedIndex)Dim id2 As ObjectId = listLayerID(CB_List_Layer.SelectedIndex + 1) Dim first As DBObject = tr.GetObject(id1, OpenMode.ForWrite)Dim sec As DBObject = tr.GetObject(id2, OpenMode.ForWrite) first.UpgradeOpen()first.SwapIdWith(id2, True, True) tr.Commit() end using
id1 is the ID of the first layer, and id2 the id of the second layer. ListLayerId contains IDs of all layers. CB_List_Layer is my CheckedListbox.When is swap 2 layers, it don't swap objects in the layers. (ex : What i've got now :
Obj1, Obj2 in layer0 and Obj3, Obj4 in layer1 SWAP Obj1,obj2 in layer1 and obj3,obj4 in Layer0.It's not what i want. I want : Obj3,Obj4 in layer1 and Obj1,Obj2 in layer0)
My hospital has been bought out by another hospital. Is there an easy way to change my titleblock. I am using project navigator and I have changed my templates.
I have an Inventor license that doesn't include Autocad. We have some old Autocad drawings that I would like to write a program to extract the titleblock info which I believe is probably done with attributes. Not sure though.
is there any way for me to get to that info without having a seat of Autocad? In Inventor we can use apprentice to do similar things.
I have a drawing I'm working from where everything was drawn in model space including the drawing titleblock and the grips for an archD plot. A single viewport is used in paper space that encompasses the entire drawing - titleblock and all. My problem is that I want to use a different scale in the paperspace layout but keep the titleblock (and archD plot grips). Adding another paperspace viewport in the centre of the original does not seem to work as when I adjust the viewport scale it zooms in far too much. Is there a simple solution that I am missing?
I need to insert a barcode into my drawing titleblock. I have the font loaded that I need, I just can't get it formatted so my barcode reader will read it. I am using the field "filename" to drive the text in the barcode. My issue is I need and asterisk as a prefix and a suffix to my file name so my barcode reader knows where to "start and stop". How can I format the field "filename" with an asterisk (*) as a prefix and suffix?
One of the problems we face in 2010 is the part labeling issue, where it labels the family name for a part and not the description name. The way to get around this was to do a swap part. Well for me when i lay out a storm network, i create it by pipes only and then swap the parts that i need to. The only flaw about this is that you can only do one swap part at a time.
Well if you go to civl3dreminder blog site there is a fix for that. I actually tried it and it worked. I was actually able to swap pipes and structures at the same time. This routine will definitely come in handy.
Swap parts is not working for my structures. When I swap a structure it becomes unselectable and if I close out the drawing and re-open it the part is gone. I am running C3d 2012 64 it with the latest SP. I've attached the drawing.
I use a single IDW template for all my drawings. In it, I've got multiple dim styles.... One is Inch, one is mm, and one shows alternate units as Inch (mm).
In my titleblock, I've got a box that says "Units: " and I've currently got this setup as a prompted entry so that I'll have to think about it when I start the drawing and manually enter "Inches" or "mm" or "Inch (mm)".
Is there a way to automate this so I don't have to manually enter it, or remember to change it if the units change down the line?
Whenever I plot this perticular dwg to a pdf, the pdf comes out perfectly fine. But when I go to print the pdf... the titleblock and some hatches don't show up. All the hatches are on the same layer and the titleblock is xrefed in the same as all the other sheets in the set, which all are fine as well.
I am trying to change the titleblock definition of a drawing when I run my custom ilogic code. Currently (and for the past few years) the drawing name is defined by the drawing properties part number but when I run my code I would like the drawing name to be defined by the model properties part number as shown below:
Currently the textbox for the part number is configured as below:
And I'd like to change it to this:
The code I have to find the part number is as follows:
Dim x = 1 Dim oTxtBox As Inventor.TextBox For Each oTxtBox In oDrawDoc.ActiveSheet.TitleBlock.Definition.Sketch.TextBoxes If oTxtBox.Text = "<PART NUMBER>" Then oStuff =
Plotting from the Layout - Model is plotting fine, XREF Titleblock is plotting out too light, about 20% of what model plots.
XREFd on 0 layer (tried on different layer, result = no difference) all other aspects of plot are correct
XDWGFADECTL set at 1
LAYLOCKFADECTL set at 1
Print Preferences
- line and text (not photo)
- dpi 600
I found a work-around but it isn't realistic in the longterm, I inserted the Title block as a BLOCK and exploded it, and then the titleblock plotted fine with each of the different Title Block layers plotting correct to pen width.
I'd like to have something like field text in a titleblock definition, where instead of the user manually typing the entry, they would have to choose option A or B for example.
I am running Autocad 2012 and I tried to use the block swap command under the Express Tools. After selecting the block that I want to replace, I get an error stating that the block name contains an invalid character. The name contains invalid characters. The name is: DomeCamera_WallMount, but in the command bar it says object name:*U302. The * is what Autocad doesn't like.
When I attach a titleblock as an xref in paperspace, it is not lined up on my page that I have set up. It attaches to the upper right hand corner of my screen and I have to manually move it on top of my paperspace. I know there is a way to have them automatically line up.
I have just managed to create my own title block and have an area within for material. I always use the iProperties to populate the titleblock but there isnt a field for material? Is there a way to add a field so it does what i need?
I got this weird issue when placing my custom made titleblocks in AutoCAD. All the attributes of the block jump to standard text style when placing it in my drawing. Allthough this ain't allways happening. It seems to me like there's a setting for this but i can't find out how.
It can happen suddenly too. Like when i open a new drawing and then add my titleblock, it's like it should be most of the times. Allthough when i start to edit the block (scale/move/copy,etc) it can change like you can see in the drawing below.
Offcourse, as a company, you do not want to deliver your drawings with a titleblock like this.
I have a problem with some of our drawing sheet attributes that we are updating from a CSV file. The attributes are originally in Arial Bold but when we run the update routine the font disappears, if we run the update routine a second time it reappears correctly updated but the font has changed from Arial Black to Standard.
I have rebuilt the titleblock and get the same result.
I cant get into the routine because its locked away in an FAS file and the manager is on holidays for a couple of weeks.
I have been searching for some information on how to pass objects into a function so I can mess with their properties. Somehow I haven't been very successful. Anyway...What I want to do is take two items (light fixtures) and swap their positions on the drawing. It seems like it must be really simple, but I'm just not finding the key puzzle pieces to do it. It seems like if I could figure out how to pull two objects into the function (whether by selecting them and running the function or by selecting them after I run the function) I could very easily save the coordinates of one to variables and then just swap them.
I have created a new layout from Templates that are the C3D standard templates. I get the below messages in my command bar and subsequently my template does not have any of the blocks, north arrow...nothing. Just a blank sheet. Why? See below messages that I copies from the command bar....
Command: <Layout from Template> Duplicate definition of block _ClosedBlank ignored. Duplicate definition of block AeccTickLine ignored. Duplicate definition of block AeccTickCircle ignored. Duplicate definition of block North ignored. Duplicate definition of block Graphic Scale - Imperial ignored. Duplicate definition of block ANSI D Title Block ignored.
is there a way to see the titleblock info of multiple sheet .idw's in vault explorer? I want to export the masterdata from all my .idw - files + sheets in one excel.I'm using Vault basic 2013/Inventor 2013
When i try to copy paste some drawing entities from a heavy drawing file to any other file, the program blocks and says 'not responding', endlessly. So i always have to shutdown the program. I experience the same problem using the designcenter: when I try to copy a layout into another drawing, my computer gets stuck.
Another annoying problem with these files is that they are so heavy, while in fact they shouldn't be. I tried the aectoacad file command. In result the file id half as big, but after I open it and save it, again is the original size.
Every now and then I go back and try to use publish to speed up printing but I always go back to plotting one by one.
I work in a housing construction office and I have 10 separate drawings side by side in model space for house plans that I need plot separate to give to certain people. My problem isn't that I can't publish them separately its that I can't save them over existing pdf's individually predetermined.
Q1. do i just have to go through and change every layout name before or after i publish?
Q2. how do i change the output publish location?
Q3. can each layout be saved to a different existing pdf and remember it?
Q3. can i save these setting across to a new drawing?