AutoCAD .NET :: Adding Entity On New Drawing (document) With New Layer
Nov 29, 2012
I am trying to add an entity on a new drawing (document) with a new layer.
Following is the code snippet I have right now.
[CommandMethod("TEST")] public void Test() { Document newDoc = Application.DocumentManager.Add("acad"); Database db = newDoc.Database; DocumentLock docLock = newDoc.LockDocument(); try { using (Transaction tr = db.TransactionManager.StartTransaction()) { BlockTable bt = tr.GetObject(db.BlockTableId, OpenMode.ForRead) as [code]..........
PTPUtils.CreateLayer() method creates a new layer in the given DB. However, the code gives me an "eKeyNotFound" exception in the line p.Layer = newLayer.
If I remove the p.Layer line, the code works very well. But the entity only goes to the default layer "0".
View 1 Replies
ADVERTISEMENT
Oct 9, 2013
I have opened a document with several xref and i want to add new entityes into those xref. How can i do?
We launch _refedit/_refclose commands in AutoCad Command line for this. I want to do the same in Autocad.NET
View 2 Replies
View Related
May 10, 2012
I'm trying to add an attribute to an entity, however it seems that the AttributeDefinition requires a Point3d and as such appear in my modelspace. I don't want this, i just wanted it to appear as an attribute with a value when i click on my entity, is there any way of making it so that i does not add into modelspace?
BlockTable bt = (BlockTable)trans.GetObject(db.BlockTableId, OpenMode.ForRead);for (int i = 0; i < prSelectionResult.Value.Count; i++){ // Get the entity the user had selectedEntity ent = (Entity)trans.GetObject(prSelectionResult.Value[i].ObjectId, OpenMode.ForWrite);if (ent.GetType() == typeof(BlockReference)) { // Add attribute to layerBlockReference blockRef = (BlockReference)ent;.
[code]...
View 8 Replies
View Related
Nov 4, 2012
We are civil engineering company, and most of out work is to get drawing from a civil architects and add our layer on that drawing, but when opening those drawing we get the message that there is ObjectARX missing, and from that point on our life become very difficult, we cannot copy paste objects, and lots of other basic action cannot be complete without crashing autocad.
I am using AutoCAD 2010, but i saw it happening with all the versions of AutoCAD.search for enablers are set on in Option.
View 6 Replies
View Related
Jul 30, 2013
The code below crashes with an "attempt to write to protected memory" in debug mode (it crashes when it hits acDocMgr.add)but in the Release version it works fine. I am using Command Flags.Session
Dim acDocMgr As DocumentCollection = Application.DocumentManager Dim pStyle As Integer = Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable("PSTYLEMODE") Dim acDoc As Document = Nothing If pStyle = 1 Then acDoc = acDocMgr.Add("acad.dwt") Else acDoc = acDocMgr.Add("acad -Named Plot Styles.dwt") End If
View 7 Replies
View Related
Dec 2, 2012
How to delete overlap entities in drawing?
Here i attached the dwg file.
View 3 Replies
View Related
Oct 27, 2011
How do I get the xrecord attached to an entity in a drawing, without key?
View 1 Replies
View Related
Feb 10, 2012
how to make a layer or an entity transparent within a viewport?
I figured out the following code found in:
[URL]
It gives an error at New Autodesk.AutoCAD.Colors.Transparency(127)
Using transactie AsTransaction = DWG.TransactionManager.StartTransaction
Dim Layertable AsLayerTable = DWG.LayerTableId.GetObject(OpenMode.ForRead)
Dim VP AsViewport = transactie.GetObject(Doc.Editor.CurrentViewportObjectId, OpenMode.ForWrite)
Dim LVPO AsLayerViewportProperties
ForEach LayerID In Layertable
[code]....
View 4 Replies
View Related
Feb 11, 2013
I tried to print thisdrawing.modeldocument in a vba sub, but it doesn't work.
View 4 Replies
View Related
May 22, 2013
I would like to add additional entities to the selection if any of the selected entities contains a an xdata value.
If I put the condition into the ImpliedSelectionChanged reactor I imagine will probably loop back on itself.
View 9 Replies
View Related
Feb 27, 2012
want to upated attributes in proxy entity is this possible?
View 1 Replies
View Related
May 29, 2013
When I add "Document Settings" to the quick acess toobar it causes Inventor to Crash when I close the active .ipt, idw, etc.
View 6 Replies
View Related
Sep 24, 2012
Is it possible to lock a layer within a document and password protect that specific layer?
View 3 Replies
View Related
Nov 10, 2013
How do I add a psd element to a pdf file? I'm trying to add a logo in psd to a pdf document.
View 1 Replies
View Related
Feb 23, 2005
is there anyway of adding sound to a photoshop document in image ready or just regular photoshop, i wanna the sound of a gun firing,
i have ps 7.0 with image ready and photoshop 8.0 cs with image ready
View 3 Replies
View Related
Oct 30, 2008
I am creating some documents in CS2 that will be used on a waiting room monitor to show announcements, pictures, etc.
I need to add several images to the same document.
What is the best method to take three images and add all three to the same document?
View 1 Replies
View Related
Apr 4, 2013
I want to add a vector image(.ai file) to my photoshop document, how would I do that?
Currently I export the vector image as png, then i import the png to PS, but it is a raster image, I would like for it to be vector, like a custom shape...
View 2 Replies
View Related
Jun 2, 2013
this is my problem:
Pic 1. I have an image I want to use as a background, however the image is not complete. I need a part of pic 2 to fullfill it.
Pic 2. The colors around the object doesn't match the colors of Pic 1.
Normally it would be best to cut the object out. However in this case it wouldn't look nice (the object is mixed out (in color) with the rest of the image). If I cut out something the object won't look "proper".
My question:
How can I blend pic 2 on pic 1, using the original object from pic 2 (as it is), and at the same time blend the colors around it, so that it matches that of pic 1 / or simply remove it somehow?
View 2 Replies
View Related
May 31, 2013
I have 300 photos that are being saved as thumbnails for my online store. I am looking to see if I am able (in automated batch saving) to add "-TN" after the document name, before the extension. It will let me add the dash but not "TN."
An example of how my document name needs to be is "MyFile-TN.gif".
View 1 Replies
View Related
Sep 26, 2012
I am trying to add page numbers to an existing document. I have tried to add them in Prepress, but all I see is the "Print File Information" and even that is not in a location I want. I have the "Position Within Page" checked.
View 1 Replies
View Related
Feb 22, 2012
My document palette adds the same colors that are NEVER in my art every time. I swear it's a glitch. The colors are so bizzare. And when I go to delete any of them, it says I can't because they are in use. But they are for sure not being used.
Here's a list of the colors:
Black A0QM, Pantone 142, Black A0QM (1), Black A0QM (2), Black A0QM (3), DIC 2287p* (1), PANTONE 142 (1), Black A0QM (4), PANTONE 142 (2), Black A0QM (5), Black A0QM (6), Black A0QM (7), DIC 2287p* (1) (1), PANTONE 142 (3)
That's the order they are always in. I don't even know where you would get any of those colors and what they would be used for? Except the Pantone of course.
View 1 Replies
View Related
Aug 24, 2012
Is there event for change current (active) layer of document?
(it's not Database.ObjectModified - it's not raised).
I tried to do it with binding as:
public void Initialize()
{
var layerList = Application.UIBindings.Collections.Layers;
layerList.PropertyChanged += new PropertyChangedEventHandler(LayerList_PropertyChanged);
And -= in Terminate, but... Autocad 2012 chashed _sometimes_!!!
Impossible to understand when it happened. So I reject this way. Is there other way to handle this event?
View 2 Replies
View Related
Sep 25, 2013
I wish to open a part or assemblydocument by its item number in the drawingdocument.
I can make an inputlistbox with all Item numbers in the drawing.
I can also link the result of the inputlistbox to the partslistrow.Item("Item").Value.
I am stuck here. I can not find the link/reference from a partslistrow to a document.
Is there a propertyfield that keeps the link? Or another way?
Comparing partlist and BOM cells by value is not a method I can use
View 2 Replies
View Related
Jun 18, 2013
If i made a workplane include in a drawing document with api, then it will display in the view as a center line.
I want add some note to the Center line,but i didn't know how to select it with api, Is there have the API function to do this work?
View 2 Replies
View Related
Nov 17, 2011
I have a drawing of a floor plan, and on a separate drawing I have text that I need to add to the floor plan drawing.
I've used the XREF command and positioned it exactly where it needs to go, but I can't edit the text drawing unless I "Open XREF in place"
I got close by going to the XREF dialog and "Binding.." the drawing as an INSERT and now it's one huge block.
I'm trying to insert the drawing with the text on the drawing with the floor plan so it's one drawing and so I can edit the text or move things around if I need to.
View 5 Replies
View Related
Jun 3, 2013
Im looking to make a simple ilogic rule that can toggle an option in the document settings, the setting I would like to change is the Document settings> Modeling> Participate in assembly and drawing sections
I would like a form to switch the option on and off quickly, its a really usefull function however I know a few of my colleagues wont use if they cant find it easly.
View 1 Replies
View Related
Apr 16, 2012
After looking thru the api, i'm finding it hard to get a list of orphaned dimensions.
I can get a list of all the dimensions...easy.
I've basically deleted a part from the assembly and now want to remove that dimension in a section view on the drawing document.
But looking / comparing the properties of a non-orphaned vs an orphaned shows nothing.
Is there an orphaned list?
Is there a color override switch somewhere?
Or can I somehow get the object that the dimension is trying to reference and check to see if it is valid or has a valid file reference...or something?
View 8 Replies
View Related
Jul 13, 2009
I am trying to create a new base view in drawing-document.
I can get hold of the view but cant find a way to set reference data --- would like to set the "Line Style" to "As Parts" and "Hidden Line Calculation" to "All Bodies".
View 5 Replies
View Related
Jun 13, 2011
How do I add a new AeccPoint (Civil 3D) to a drawing?I'm moving over from the COM side and I have hit a road block.
I can create 3d points to add to autocad lines but I have not been able to find any docs on adding stand-alone points to a drawing.
View 2 Replies
View Related
May 27, 2011
Is it possible to add materials to a 2D drawing? I'm working on a floor plan and would like to add flooring materials to it but not sure how or if this is possible?
View 9 Replies
View Related
Feb 8, 2010
From a VB.Net program, I'm trying to create a dimension on a drawing document between two parts in an assembly. I can get the parts using component occurrence. The line marked below throws the following error: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)).
As you may see, I have allocated memory for both "Edge" and "Face" (Dim oEdge1 As Face) albeit one is commented out. Attached is the screen shots from the attribute helper add-in. In it, you will notice that the attributes are of type: "Face".
Public Sub CreateDrawingDimension(ByVal Part1 As String, ByVal Part2 As String, ByVal AttName1 As String, ByVal AttName2 As String)
' Get the Active Drawing document
Dim oDrawDoc As Inventor.DrawingDocument
oDrawDoc = invApp.ActiveDocument
[code]........
View 2 Replies
View Related