AutoCAD VB :: Converting AttributeDefinition Objects To Text Objects On Same Layer
May 9, 2013
I have several .dwg files that I use as templates. I run find and replace VBA routines on the template .dwg files, ie find $Flavor$ and replace it with "Grape", and then I save the .dwg to another directory with a new name.
These VBA routines work well for acdbText and acdbMText objects, but I have a bunch of AcdbAttributeDefinition objects in the .dwg templates as well.
After much research about the AutoCAD object model (I'm mostly a Microsoft Access VBA programmer), I have come to understand that these AcdbAttributeDefinition objects are actually "remnants" of a block that no longer exists in the drawing.
Anyway, I'd like to convert all of these orphaned AcdbAttributeDefinition objects to acdbText objects in the templates and then delete the AcdbAttributeDefinition objects. I have some code that does just that.
However, the issue that I am having with the code is that the newly created acdbText objects are not on the same layer that the original AcdbAttributeDefinition objects were on. I don't know the syntax to identify what layer the AcdbAttributeDefinition object is on or how to specify what layer on which the acdbText object is created.
how to keep the acdbText objects on the same layers as the original AcdbAttributeDefinition objects during the conversion and deletion process?
Here is the code I am using currently:
Sub AttConvert(dwg as string)Dim oDocument as AcadDocumentDim ent as AcadEntityDim aa as objectset oDocument = Documents.open(dwg) For Each ent In oDocument.ModelSpace If ent.ObjectName = "AcDbAttributeDefinition" Then' DO SOMETHING TO IDENTIFY WHAT LAYER THE ACDBATTRIBUTEDEFINITION OBJECT IS ON
' DO SOMETHING TO SPECIFY THAT THAT IS THE LAYER TO CREATE THE ACDBTEXT OBJECT ON Set aa = ThisDrawing.ModelSpace.AddText(ent.TagString, ent.InsertionPoint, ent.Height) End If Next ent For Each ent In ThisDrawing.ModelSpace If ent.ObjectName = "AcDbAttributeDefinition" Then ent.Delete End If Next ent End Sub
View 1 Replies
ADVERTISEMENT
Oct 26, 2012
I would like converting all objects that has forced linetype to be on a linetype layer.
So if there are objects that have forced linetypes - dashed/hidden/phantom, etc., those entities would be moved to a linetype layer based on their forced linetype. The entities would all be changed to color bylayer, linetype bylayer.
So if there is a rectangle that is sitting on an EQUIPMENT layer, the routine would put that rectangle on a new layer called DASHED and change its forced linetype to BYLAYER.
Lastly, once that's done, the next and final step is to locate a the existing layers with matching linetype - say, OBJECTS with DASHED as a linetype, and merging it to that layer.
View 9 Replies
View Related
Jul 30, 2012
For some reason I am having issues converting a CDR file to PDF which contains objects/text with fountain fills.
I have looked at some previous posts detailing the same problem, have followed their remedies, i.e. "render complex fills as bitmaps" in the advanced tab in the PDF conversion pane. Despite these best efforts I am still having the problem of my black background; fixed in the "page layout" tab being corrupted, resulting in the background being the fountain fill once converted.
View 2 Replies
View Related
Oct 22, 2013
Can you freeze text objects on the same layer in one viewport but have it still appear on the other viewport without having two separate layers.
View 3 Replies
View Related
Jul 3, 2013
I have long used the following lisp to convert multiple single text objects into multiple mtext objects (i.e. make each text entity into separate mtext entities).
; T2M - convert individual Texts/Dtexts to individual MTexts
; modified by Xanadu - www.xanadu.cz
;
(defun C:T2M (/ ss i elist)
[Code]....
However, the mtext entity always moves position slightly (compared to the original text entity) after converting the object. better lisp that converts multiple text entities into mtext entities (which are all separate still, i.e. not joined together) without the position of the entity changing?
View 4 Replies
View Related
Jan 23, 2013
I have a conveyor layout with turntables
It's in 3D, but when I use flatshot to convert to 2D it misses out the turntables
They are on the same layer as the conveyors and both seem to be blocks01128-999-10001-A01 2D.dwg
View 5 Replies
View Related
Jun 1, 2011
Is it possible to export a Draw file with vectors and some perhaps some bitmaps into a layered Photo-Paint file?
The web coders nowadays only seem to be able to work with layered PSDs and I'm doing my designs in Draw.
View 5 Replies
View Related
Aug 10, 2007
when you convert somehitng into a smart object? What can you do with that object?
View 2 Replies
View Related
Feb 15, 2013
I have a bunch of objects on a particular layer, and they're all different colors and linetypes and lineweights, and i want them to all take on the color / linetype / lineweight that i chose for that layer.. how do i do this?
View 1 Replies
View Related
Jun 20, 2012
Say I have 2 items, one is on layer "M-Duct" and the other on "M-Pipe" (they are in the same drawing). Any lisp routine that would create the layers "M-Duct-New" and "M-Pipe-New" (based on the same color and LT as the original layers) and then move those objects to the newly created layers?
View 9 Replies
View Related
May 31, 2012
I'd like to have/write a lisp to change all objects on layer "0" to layer "PC - Module"
If possible also;
save the document close the document open next in directory run layer changer program again.
View 8 Replies
View Related
Jul 28, 2008
I have had trouble that all of my images are fuzzy when i convert any image from any program in photoshop. i do not ahve an preset filters running to my knowledge,
View 1 Replies
View Related
Jul 23, 2012
I have several vector images made up into one large image in a cdr file & i am working in mm
What the easiest & best way to convert my one large image to pixels??
View 10 Replies
View Related
Sep 17, 2013
I need merge many objects in one for export to fbx. If I delete any of polySurface objects, mesh lowpolyHouse crushes. If I stay it, than it all export to fbx file, problem is that I need mesh object only.
View 1 Replies
View Related
Nov 22, 2012
I am very much new to AutoCad, but have learned quite a bit about it in the last few days. As a part of the learning I have been building a 3D model of the shed my dad is building. But I ran into a problem on the roof and cant seem to figure out how to click everything into place.
My problem: I need to keep the size and shape of all objects while also connecting the objects to the main structure. I need to keep A and B connected to the main structure and adjust the angles so that both meet at C. But if I move one then another moves out of place. (In the pic B is out of place) All I want to do is hold the beams at A and B in their spot while adjusting the rotation on both beams to meet at C all at the same time. I have tried to fine adjust the rotation on the beams individually but still cant get them together. I cant seem to get the constraints feature to work, because I guess it only works in 2D. I have tried to use the align tool but it just throws everything haywire.
View 6 Replies
View Related
Apr 10, 2012
I'd like to know how to align an object in model space with the edge of my viewport in paperspace.
When I draw, I like to lay out multiple complete drawings in model space, make an appropriately scaled bounding box around them, and then snap a view port to the bounding box in my layout. I usually have multiple drawings lined up in a row in modelspace, so when I want a new layout I do a Save As and then pan around in my viewport to find the next bounding box, at which point I have to resize the viewport to get it to snap to the edges nicely. I really want to be able to to it the otehr way around- while panning I'd like to be able to grab a corner of my modelspace bouding box and snap it to the the corresponding corner of my viewport window. That way making new layouts would be a snap. Is there a way to do this in AutoCAD 2012 LT?
View 4 Replies
View Related
May 2, 2013
A user is having problems when using the copy command in AutoCAD 2013.
When they select objects, its not reporting on the commandline how many objects its found or keeping a running total of objects selected. Not even any duplications...
I've tested it on my machine but i cannot replicate the issue and have never come across this before!
Is it a bug? Is it a variable? User setting etc.
View 9 Replies
View Related
Jul 3, 2013
Something changed in my settings & I don't know how to chance it back. I can't click on to select objects inside or behind objects. What do I have to change to be able to select any item I click on regardless of where it is?
View 1 Replies
View Related
May 8, 2012
All the items are on one layer and i need to seperate them, i had to xref the drawing but i opened the original to double check and even there the objects are all on the same layer.
View 9 Replies
View Related
Oct 4, 2013
I work in pre-press for a Label Printing company and we do Flexo and Screen printing. I get files from designers, most files have been created in Illustrator.
I use Corel Draw X5 to do my pre-press work and some of the files I get have Lens effect objects. When I apply the "No Lens Effect" the object changes to a Symbol and it has no fill and no outline, how do I convert the Symbol object to a "regular" object?
I want to know the best way to convert these Lens and Symbol objects to regular objects that are "flattened" or do not have transparency. I need to be able to work with these objects like they are a regular vector object that can be edited for pre-press to make files to send to have films output.
OR, will an object that has a Lens effect output normally if I make a Postscript file fro the Lens effect object? Do I even need to convert the Lens effect in order to get the image to output correctly?
View 6 Replies
View Related
Mar 5, 2011
Whenever I use the Trace option to convert, the result is an image filled with closed objects. Because I use vector images with a laser machine, and because the laser cuts everything it reads, the "double" lines (shared lines of the objects) get cut as many times as they appear. So I have to go in and break apart and delete segments & this goes on for days. I've tried welding, but welding makes one of the objects disappear completely. I've tried changing from cdr to svg, exporting & importing, hoping it would simplify, but that doesn't work either. Is there a way to have the bitmap converted to simple lines instead of overlapping objects?
View 9 Replies
View Related
Feb 9, 2013
I have a drawing created where the lineweights for each object have not been associated by layer. I would like them to be so. Is there an easy way to capture all of the objects on a given layer and associate all their lineweights by layer?
View 3 Replies
View Related
Dec 27, 2011
Currently, when I'm converting architectural drawings into backgrounds for my use, one of the first things I do is select certain objects based on their layer and delete them en mass.
I'm using the QSelect dialog box at the moment, but that's really difficult. I would try writing a LISP or something, but I don't know of a command line version of the QS command to make it work.
Is there a way that I can select one object, and make it select all the other objects in the drawing that are on the same layer? The QS command is handy, but very tedious.
View 4 Replies
View Related
Apr 26, 2013
I am using Autocad 11. I am working on some 12 year old drawings for a railroad museum. They are a mess. They look like they were done be an old pencil guy. Lots of views all over the drawing space rather than using layers to his advantage.
I am watching all the tutorials that i can find. There are Blocks on wrong layers.
I want to move a group of lines (part of the stuff on one layer) onto a new layer that i have created. Is it as simple as cut and paste? How do I prevent them moving during the process?
I tried making their layer current, then selecting the items, then cutting the items. Then i made the new layer that I wanted them on Current, then pasted them. I has to very carefully line them back up, and they are still on the original layer.
View 3 Replies
View Related
May 11, 2011
Some questions of layers:
-here can I see visually which objects are deposited in the layers like in illustrator, see screenshot,
-is nesting of layers allowed
-what is the easiest way to swap objects from layer to layer
-how can I select all objects from one certain layer?
illustrator_layers.jpg
View 5 Replies
View Related
Oct 23, 2013
I have a drawing with objects on multiple layers, however when I select an object, they all show as whtever layer is showing. If I open the drawing on antoher machine, everything works properly with multiple layers.
View 2 Replies
View Related
May 1, 2012
I am trying to assign objects (only in UNLOCKED layers) with a new layer.So basically, the user will select all the objects in the drawing.
After selecting (ex. press enter after window selecting), only objects in UNLOCKED layers will have a new layer.
Following is the code I am using...But I keep getting eOnLockedLayer exception.How should I handle this issue?
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
{
PromptSelectionOptions pSelOpts = new PromptSelectionOptions();
pSelOpts.MessageForAdding = "Select all objects";
PromptSelectionResult pSelRes = acDoc.Editor.GetSelection(pSelOpts);
if (pSelRes.Status == PromptStatus.OK)
[code]....
View 3 Replies
View Related
Apr 14, 2013
Are Layer Keys only for ACA objects ?
for example:
I'd like my dimensions to be all on layer "D" in the color red.
I added "dimlinear" to the key style. but it just draws dimensions on the current layer.
View 9 Replies
View Related
Sep 27, 2013
I want to copy some objects from one drawing to another. However, in the source drawing the objects are on one layer, but I want them on another layer in the target drawing. I know pasting the objects as a block fixes the problem, but as soon as I explode them they're back on their original layer - and I have to select them all and move them to the preferred layer - which can be tedious with multiple objects.
View 9 Replies
View Related
Feb 8, 2011
I have a plan view of a residential building. I want to remove some columns. I may need them later so I don't want to delete them.
I want to move them to a new layer (layer name: hiddenObject) and turn this layer off to unshow them.
When I move them and turn that layer off, first, the color of those objects didn't turn to layer's color and second they don't disappear.
What is wrong with my procedure?
View 5 Replies
View Related
Jul 5, 2013
I'm working with AutoCAD Architecture 2011 and working in the xref. I have my layer states set up, no problem. However, I have a layer that still shows up in all states even tho it is not saved in the layer states. If i click on it, it shows as off. It is a block, I have it on the ByLayer and the correct layer.
View 1 Replies
View Related