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".
I have a Lisp that I have been working on with some folks in the office, and i feel like i am close, but i am not getting the cigar. The idea would be to have the lisp allow the user to select a nested x-ref entity, and change the color and linetype of the selected layer, similar to the old "LAP" command (I know it is a dinosaur, but I still miss it). I seem to be doing swimmingly, code I have quasi-plagiarized. It seems to crap out where i try to pass the selected linetype back to the layer. I get the nastygram "Command: ; error: no function definition: GETLINETYPE" right after selecting the linetype from the dialog.
Code below...
x(defun c:CX (/ Sel EntList DataList cnt Num ClrNum EntData) (if (setq Sel (nentsel " Select object to change layers color and linetype: ")) (progn
Context : AutoCAD Map 3D 2013Visual Studio 2010.NET 4.0, C#, WPFFDOOracle DataStore
Requirement : When I start AutoCAD Map 2013, a default document called "Drawing1.dwg" is opened. I use the command NETLOAD to load my assemblies. Final Users don't NETLOAD, an entry in the registry does the job automatically. During Initialization, my application downloads from the database a Template DWT file to initiate automatically the connection to the DataSource, and shows the different layers and styles configured by the customer. A new drawing based on this DWT is then generated.
However, the first default document remains opened. It can be sometimes annoying for the user to have both documents opened. I've never found a nice solution to close this first default document.
My technical implementation, not working :
In the Initialize method coming from IExtensionApplication, I start my application (loading business classes, user interfaces, etc...). Once started, I download the DWT, and add a new Document to the DocumentCollection (Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager). To this new Document, I handle many events such as CommandWillStart, CommandEnded, CommandFailed, etc... At this time, my Application asks to the user to log in. And finally, I browse the whole DocumentCollection to try to close all documents that are not the new one based on the DWT.
DocumentCollection doc_coll = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager; _kleverageDocument = doc_coll.Add(dwtFilePath); if (_kleverageDocument != null) { _kleverageDocument.ImpliedSelectionChanged += new EventHandler(doc_ImpliedSelectionChanged); _kleverageDocument.CommandWillStart += new CommandEventHandler(doc_CommandWillStart);
[Code] ....
When I call the CloseAndDiscard method for each of the other Documents, I always get an Exception telling me that the document is currently drawing. Actually, the command "NETLOAD" is stil running. How can I do ? I tried another way, by using handled events on DocumentManager
I am importing a dgn into autocad by using the SendStringToExecute method with the 'Import' command. My problem is that once I have the dgn imported I want to do some modification and then save the drawing, but setting a new dim to the current mdiactivedocument still gives me the initial document and not the one opened by the import command as I had thought it would.
How can I switch the mdiactivedocument over to the newly opened document?
using CorelDRAW X6. I am having trouble when opening SVG documents in CorelDRAW X6. They seem to always be 33.333% smaller than the size I saved them in Adobe Illustrator.
I am more familiar with AI and use it for most of my design work. I use CorelDRAW mainly to save files as HPGL plotter files to cut designs with a CMC machine (there is no way to my knowledge to save HPGL files with AI).
When I open an AI file in CorelDRAW it is always to scale. However when I save it as an SVG file and open it with CorelDRAW it is always exactly 33.333% smaller than the size I saved it as in AI. While I can open AI files in CorelDRAW for my purposes it is easier if I save as SVG. I just want it to be the same scale when I open it in CorelDRAW but it is always smaller (by exactly 33.333%)
Not that it is that big of an issue, I can always scale it to the proper size. I would just like to understand why it works this way and if there is a way to correct it.
How can I create a layer on my xref so it doesn't affect othere sheets referencing my drawing without having to open a couple of hundred draiwngs. I know I can create my layer, freeze it, save my drawing, open all sheets referencing my xref and save them. Better yet, is there a setting I can use that makes my new layer pop up frozen on for all sheets while I work on my xref, on a newly created layer?
i am trying to set up templates at a new job and i want to create templates with an xref for the title block so when we start a new drawing, we use the template, save to the project file and everything is there with our title block already xref'd. my problem is, the path on the xref'd title block stays the same and is still referencing the location of the file i used when creating the template. if possible, when i save the new drawing to the project foldeer i want the xref to also move to the project file and the path to the xref to change.
if there is any way to create a new 'FeatureBasedPattern' within an assembly document. I have 2 assembly occurences - parts. In the Part1 i created a RectangularPattern of workpoints. The Part2 is going to be used in the new pattern. I tried the following VBA code, but it doesn't work.
Dim oPart1 As ComponentOccurrence Set oPart1 = oAssDef.Occurences.Item(1) Dim oPart2 As ComponentOccurrence Set oPart2 = oAssDef.Occurences.Item(2) Dim oTG As TransientObjects Set oTG = ThisApplication.TransientObjects [code]...
The Call function breaks with: "Invalide procedure call or argument". I also tried "Set oAssemblyPattern = oAssDef.OccurencePatterns.etc...." instead of Call function, but with the same result. Same error for declaration change of "oAssemblyPattern" to "FeatureBasedOccurrencePatternProxy".
I am trying to open Lightroom 4 from my desktop and it keeps giving me this message:The Lightroom catalog named "Lightroom 4 Catalog" cannot be opened because another application already has it opened.
My part unit length has been setup as millimeter(mm).Once I created a line within 2d sketch by VBA script, the result of length always become to 10 times of value.For example, the two points of line is (0,0) and (0,4). But the result of length measured is 40.
My problem is how to create a line with part document setting?
In an assembly document, I try to add a MateConstraint between male and female side of an 45 degrees elbow. The male side is built on the XZ Plane and Y Axis And I try to create a workplane on the female face.
But a got an error with the last line of code. Here's my code (vb.net code) :
' Get application object Dim app As Inventor.Application = GetObject(, "Inventor.Application") Dim doc As Inventor.AssemblyDocument = app.ActiveDocument
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".
I am trying to create a new document with new layers, but paste in an existing floor plan since it's the shell I need to be using. When I copy clip and insert into new file, all the layers import with it. I transferred everything onto 0 layers and went into my layer manager to try and delete the extra layers and it says i cannot delete o, xref dependent, etc. I want to create my own layers, and then assign the lines in the plan myself onto the new layers.
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]........
I know that in ACAD you can use the xref manager to see where the actual file for the xref resides on your computer/server/etc. What I'm curious about is whether or not the inverse action is possible. Can you somehow access the file (not the output sheet where it's being xref-ed) and see what other files are using it as an xref?
I've come in on a project that is nearing completion and have been assigned the task of "cleaning up the project folder." Unfortunately, there are a ton of files in the different folders that are no longer in use on the final output sheets and I need to keep the ones still in use and archive the ones that are no longer needed. What I've been doing is going through those sheets and reviewing the xref manager for each sheet to see which files are actually put onto those sheets and making a physical checklist from which to organize my findings. Once the checklist is made, I then archive all the files that are no longer being used.
Is it possible to run a lisp which can extract all the xref names, make a layer with that name and then change the xref on the layer? I have got a similar routine from earlier posts but it doesn't work if any xrefs inserted in paper space (works fine on model space). could change this routine allowing to change the layer of xref in paper space too.
(defun dxf (i a) (cdr (assoc i a))) (defun c:lxr ( ) (setq ss (ssget "x" '((0 . "INSERT"))))
I am using (trying to anyway) a :VLR-xrefSubcommandReloadItem reactor. My only question is how to get the xref/block name from the 'reactor callback data' Object ID.
I am ultimately trying to pass it to (vla-get-xrefdatabase ....), but I cannot figure out how to turn the second parameter from the reactor callback data into something I can use - for example the second parameter returned may be "65" or some other number.
when you bind an xref the link disappears from the xref manager.
is it possible to bind an xref, but preserve that link in the xref manager? i realize that will lead to two copies of the same object in the drawing (one xref, plus the new block). everyone's okay with that happening.
I am a casual photoshop user. I need to design a tagged pdf documents which is accessible to use with Dynamic PDF. When I searched online, lot of people are using Indesign but I have never used it. So, is it possible to create tagged pdf document from PS or I need to learn Indesign?
I'm putting together some design specs and I want to create a clickable table of contents that will navigate to a different section of the document. IE. artboard #27
From what I've seen thus far it looks like I can add links but only to websites and they are only clickable in PDF mode.
Is it possible at the very least to make my clickable TOC when converting my document to a PDF? and, is it possible to make it clickable even if it is in .ai format?
I have been trying to create a PDF of a 36 page document. However, when I get to page 6 I get a message 'downloading font' and then the programme hangs and I have to use windows task master to close it down. There are only three fonts being used on the page and according to Font Finder no fonts are missing. This is driving me crazy and I'm fast approaching my printers deadline.
How do I get the full Xref Path name instead of Xref.dwg? I'm scratching my head is this totally under my nose... cause I don't see where the property is stored. I'm getting EV_BDR.dwg instead of C:folderEV_BDR.dwg