Im trying to figure out what I can do differently in my code to have it show the newly placed text immediately after choosing an insertion point. Im guessing it has to do with a nested transaction and my loop, but Im not sure how to fix.
The code below is to label the layer of a selected entity. If in paperspace, label in paperspace and if in modelspace label in modelspace. Ive been testing this on the "blocks_and_tables_-_imperial.dwg"
Imports Autodesk.AutoCAD.RuntimeImports Autodesk.AutoCAD.ApplicationServices.ApplicationImports Autodesk.AutoCAD.DatabaseServicesImports Autodesk.AutoCAD.EditorInputImports Autodesk.AutoCAD.GeometryImports Autodesk.AutoCADImports Autodesk.AutoCAD.ApplicationServicesPublic Class Class2 Public Function myAnnotate(myDbIn As Database, mySpace As String, myTextContents As String, mySTPT As Point3d) As ObjectId
[code]........
I get the following message when I try to update a view on a drawing. Cannot coalesce given transaction with a previous identified transaction. Some times it shows up other times everything works out perfectly fine.
Transactions -- Can you commit a Transaction within a Transaction without any problems? I have one transaction that cycles through all objects in drawing..
I have another transaction that purges all purgable objects. Can I call the Purge Function if I've already started a transaction? What's the proper protocol here?
'Purge Database Dim count As Integer = PurgeDatabase(DatabaseIn) Debug.Print("Number of Items Purged: " & count) 'Level 1 Start(Transaction/Drawing Database)----------------------------------------------- Using myTrans As Transaction = DatabaseIn.TransactionManager.StartTransaction 'Read Drawing Database [Code] .........
I am walking through someone else code in order to make sure I understand some principles (inserting blocks via a jig) and I cam upon a couple of lines that I do not understand:
space is the blocktablerecord for the current space and tr is the active transaction.
Here is what I don't get: If I append the entity to the space in the blocktablerecord inside of the transaction why do I also need to add this newly created object to the transaction with the AddnewlyCreatedDBObject method as well?
i have got a problem with AutoCAD 2010 right now. Im having some procedures that take very long to process in between a Transaction Manager. Start Transaction and Commit/Abort.
When taking too long AutoCAD sometimes just disappears/crashes without giving a call stack/Exception or anything. There are also no memory leaks or exceptions raised, though i send some status messages to the command line of AutoCAD.
Does AutoCAD need anything like a KeepAlive? Do i have to send it some specific messages or anything? Is that a common problem?
Coworker opened a drawing that he created yesterday. Upon opening he received the following error - "Attempting to end an invalid transaction. Id: 2008125432". He hit OK and the program resumed. It did not crash. There is no red plus in the menu bar.
Inventor 2013 SP2 update 1 Windows 7 64x SP1, 12GB RAM NVIDIA Quadro FX 2000, driver 8.17.12.7642 (12/10/2011)
I have a command to open some dwg files and print them. I´m using the Sub imprimePDF. When I did the code with (AutoCAD 2011 and VS 2008) , it runs ok but now it´s wrong.
This is the sub
Sub imprimePDF() Dim myDWG As Autodesk.AutoCAD.ApplicationServices.Document myDWG = Application.DocumentManager.MdiActiveDocument
[Code]....
When I´m debugging the code, last sentence produces an error: 'tr not declared' and I don't know why.
Has seen that even if a work plane, work axis or other work feature is created during a transaction, the screen will still update? The actual features I create using these work features within the same transaction still work just fine.
I'm having a problem with RotatedDimension. I'm initializing it with some values and after I commit the transaction the value of TextPosition is changed.
Got a nested symbol. Rather simple one. Inside the symbol is a background rectangle and a text field. When I click a button, it should insert the HTML I give it from the click event.
Now initially I did this by just using the text field by itself. No nesting. This is the code:
sym.$("copy").html("Edge Rocks!"); OK, success! The text loaded just fine.
Now let's insert that text field inside of a symbol. And let's call that symbol 'content'.Now I try....
sym.$("content").$("copy").html("Some new text");
Result? Nothing.
Tried using stage instead of sym and even added a var stage = sym.getComposition().getStage() statement before that. Nope.
I've imported the PSD file as a comp, and made changes to the text animation, but this is now a nested comp, and the music is in the main comp. How do I change the timing of the nested comp while still having visibility of the music track?
When I am placing a roll-down shutter family in the same wall and same place as a transaction window family that is the same size gives me an error stating the family is not cutting anything and has to be deleted. How do other people do this?
I had to reinstall my lightroom 5 and since then the before/after (Y/Y) icons are missing. Also the done button is missing when I go the use my transaction brush.
I select all entities via Editor.SelectAll() method, but the nested entities (inside Blocks) are missing. Do I have to resolve them by iterating through all blocks afterwards or is there a Prompt Selection Option that can be set?
I don't want the user to select the entities, instead I loop through the whole drawing.
I'm attempting to have the user select mText from a nested block within a block and then copy the nested block to model space out of the block. I'm able to change the mText successfully, but when I attempt to get the nested block it is not in the list of GetContainers() it only contains the block in model space and the model space block. The nested block is missing in the list. I'm using AutoCAD Civil 3D 2013.
Here is the code to select the mText object which works correctly.
Sub GetNestedMtext() ' Have the user select an object. Using the prompt provided. Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor Dim entopts As New PromptNestedEntityOptions(Environment.NewLine & "Select a mText in block to replace: ") entopts.Message = Environment.NewLine & "Select a mText in block to replace: " Dim ent As PromptNestedEntityResult = Nothing Try ent = ed.GetNestedEntity(entopts) Catch ed.WriteMessage("You did not select a valid entity") End Try If ent.Status = PromptStatus.OK Then CreateDuplicateBlockInModelSpace(ent) End If End Sub
Here is the code that attempts to get the nested block which is missing the nested block.
Private Shared Sub CreateDuplicateBlockInModelSpace(ByVal ent As PromptNestedEntityResult) Try Dim containerObjIds As ObjectId() = ent.GetContainers() Dim blkToExtract As BlockReference = DirectCast(containerObjIds(1).GetObject(OpenMode.ForRead), BlockReference) Dim blkToPlace As BlockReference = blkToExtract.Clone() Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument Dim db As Database = doc.Database Using tr As Transaction = db.TransactionManager.StartTransaction Dim acBlkTbl As BlockTable acBlkTbl = tr.GetObject(db.BlockTableId, OpenMode.ForRead) Dim acBlkTblRec As BlockTableRecord acBlkTblRec = tr.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), OpenMode.ForWrite) acBlkTblRec.AppendEntity(blkToPlace) tr.AddNewlyCreatedDBObject(blkToPlace, True) tr.Commit() End Using Catch ex As System.Exception End Try End Sub
Is there another way I can get the parent block object for the nested object?
I am trying to get either location, insertion point, or center of an entity that is inside of a block. I'm getting subentity using the Editor.GetNestedEntity. I create a FullSubEntityPath for highlighting, that works well, and I have looked at using GetSubEntityGeometricExtents using that same subentitypath, but not having any luck, I can't seem to find any documentation on using that method.
I know I can get the location of the owner, then calculate the location of the entity based off of that, but I'm looking for an easy way now, if that don't work out, I can do the lengthy approach.
There are blocks in the drawing, each containing several nested entities. Need a command which would find all the nested entities which got into the selection area provided by user (not necessary to select entities, just get the ids). GetNestedEntity() does what I need but for a single entity only.
Selection of 'Trim' command does exactly what I need. How could I achieve the same behaviour?
Start with a new drawing Drawn a rectangle. Place a block which has an attribute with a number at each corner. ie. 1-4. Convert all objects into one single block. (the attributes become nested). If you use data extraction and retrieve the attribute number, position X and position Y, and output to a table the information displayed is correct. HOWEVER, if you rotate the block and update the link the coordinates become incorrect? This seems to be an issue with nested blocks?
wondering if its possible to turn off lines inside of nested blocks.
When we tried to do this inside a heavily layered and blocked drawing, it seemed to make the file unresopnsive, unloadable, and general "autocad freezing" issues. We Reconsitituted the entire file from the ground up and found that by NOT turning off these lines inside of nested blocks (ceteris parabis) the file works fine.
We like to turn these lines off becuase different teams are working on different parts of the drawing and we like to focus on one section by turning the other off. Is this possible? Is there a better way to do this?
My question pertains to layer colors from xrefs that have other xrefs nested inside them.
When I get xrefs from the architects, I get a building layout, RCP, space layout, etc. I tie all these together into a single "architect base" xref so I don't have to attach 4 xrefs to each new file I create. What I would like to be able to do is set all the layer colors in the misc. architect xrefs in my "architect base" file and have those color settings propagate into my drawings as I create them. This comes into play especially if I have to create a new drawing late in the project, and I don't want to have to go set hundreds of layer colors individually. ?
Visretain comes to mind, but visretain (if I'm correct) is really for keeping xref color settings in your current file from session to session, not in a new file that you are creating using an xref.
The NCOPY command used to allow you to copy a nested object onto the current layer in the active drawing. Now, in 2012, it seems to copy the nested object, but it brings the reference layer with it. Is there a setting that can be changed so I can still do the former?
My primary goal in this exercise is to select a nested polyline within a block and have access to its grips. I'm still not even sure if it's possible.
However, before I'm even getting to that stage I'm hitting some problems. I have some custom objects which all in some way or another inherit from BlockReference:
BlockReference
-Derived Abstract Class with common attributes
-Derived Concrete Class1
-Derived Concrete Class2
-Derived Concrete Class3
I insert instances of my derived concrete classes using jigs( Class2 for example is created using a polyline jig). However, when I select the block generated from it using a PromptSelectionResult, it returns a BlockReference, not the derived concrete class, not the derived abstract class.
When I try and cast that as the correct class type I get an error telling me I can't cast from the Base class to any of the derived classes.
So, firstly, why is it returning a BlockReference when the object I'm clicking on is an instance of a type that indirectly inherits BlockReference? And is it even possible to gain access to a nested entity's grips? I followed post here: [URL] .... but it doesn't give me what I need.
I've tried ed.GetNestedEntity and the AllowSubSelections property of PromptSelectionOptions and had little joy.