AutoCAD .NET :: Cannot Set MdiActiveDocument
Aug 22, 2013
I cannot seem to set the MdiActiveDocument synchronously.
I have code inside a <CommandMethod> that creates a drawing and then writes any error information to the command line. Since this is started in one document, if a fatal error occurs and the drawing does not get created, that message goes to the original document's command line.
In the case where a drawing gets created with errors (say partial success), I would like the errors to appear in the new drawing (new active document's) command line.
The behavior when setting Core.Application.DocumentManager.MdiActiveDocument is peculiar. The application can hang for a long time if you do not click anything. If you click the document (from the taskbar or clicking on the window), it breaks out of the hang and continues to execute, but the active document is not changed. The MdiActiveDocument still points to the original document. You can also see that it does not change because doc.IsActive = False. This state could be because when you clicked, you really did make the original document active (again? still?). To break the hang, I think the click has to be on the original document.
On an example like [URL] ... there is no action taken after MdiActiveDocument is set, so I assume that it is actually set when the command is completed, not synchronously. I am not absolutely certain of this, though.
<CommandMethod("AUTODRAWPN")> _
Public Sub DrawPartNumber()
Dim ed As Editor = Core.Application.DocumentManager.MdiActiveDocument.Editor
If IsNothing(drwr) Then
[Code] .......
Is there a way to set the MDIActiveDocument? Should it be hanging like this? Should I be looking at an altogether different way to handle this?
Trying to use doc.Editor without setting the active causes a eNotApplicable error, so that is not a way out.
I am using AutoCAD 2013. The following link implies that this could be a 2013 specific problem, but I do not know that for sure. [URL] .....
View 1 Replies
ADVERTISEMENT
Nov 5, 2012
I'm trying to switch documents and add some text. But the program switches to the document then freezes without executing any lines after switching documents.
If flyToHandle <> "" Then Dim docIsopen As Boolean = False For Each doc As Document In DocumentManager If doc.Name = flyToDwgName Then docIsopen = True acdoc = doc DocumentManager.MdiActiveDocument = acdoc End If Next If docIsopen = False Then acdoc = Autodesk. Auto CAD.ApplicationServices.Application.DocumentManager.Open(flyToDwgName, False)
[code]....
View 3 Replies
View Related
Feb 19, 2013
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?
View 1 Replies
View Related
Jan 16, 2013
When i use AutoCad 2010, that is on a wind 7 OS, appear a message that indicate the next.
A software problem has caused autocad to close unexpectedly.
View 1 Replies
View Related
Oct 2, 2013
In Autocad 2014 when I use the zoom or pan command transparently some information disappears (hatch) and only reappears when I finish the command. This did not happen with version 2009.
View 2 Replies
View Related
Mar 22, 2013
I'm trying to attach a hyperlink to a PDF but I keep getting the error message " AutoCAD could not open this file or could not parse a fle of this type". It also won't link to a Word document or speadsheet, but will link to a web page and a notepad text file.
View 3 Replies
View Related
Oct 3, 2011
Why when making PDF out of DWG, many lines comes out vague?
It can be part of a line/block/text.
It shows only on the screen and not on paper in case I print it.
View 1 Replies
View Related
Apr 2, 2012
I run ACAD LT 2010 on a Windows XP machine and also a Vista Laptop. I have tried to print the same drawing on both machines using the DWG to PDF facility with in AutoCAD. The drawing is a third party drawing in as much as I didn't draw it although it is an authentic ACAD DWG.
I get the same message but referring to different fonts - the message reads on the Vista machine:
"Cannot find or create the font "ArialMT". Some characters may not display or print correctly"
On the Windows XP machine it reads:
"Cannot find or create the font "Tahoma". Some characters may not display or print correctly"
The message seems to be generated by Adobe Reader.
View 6 Replies
View Related
Mar 8, 2012
My computer has 8 GB of RAM. However my autocad is not faster than a computer with 2 GB of RAM. I have Windows 7. Is there a way I can allocate more RAM to Autocad to make it run faster?
View 9 Replies
View Related
Dec 8, 2011
I downloaded a titleblock to look at and one of his layers for the lines that made up the bounderies of the titleblock, was placed on the "XID" layer. It was interesting to see that the lines had the properties of Polyline, although to my eyes it looked like a line segment.
what XID stands for in this case?
View 4 Replies
View Related
Jun 23, 2012
I have some problem with import SDF to dwg. Geometry in SDF is curve with mixed linear and arc segments.
But the result is not my expected result. (see image below) . All arc segments was imported not correctly.
I'm expecting my data is correctly in the sdf files, but some import mechanism not work properly.
When I make connection through FDO it's work ok.
View 2 Replies
View Related
May 6, 2013
I've been attempting to use the GEOMAP command to bring satellite imagery into one of my maps. I have followed theses steps:
1. Signed into my Autodesk360 account.
2. Assigned a coordinate system (SC83F) to my map.
3. Entered the GEO MAP command and selected "A" for aerial image.
Following these steps, I am unable to display the aerial imagery.
View 1 Replies
View Related
Apr 12, 2010
I've created system printers for our office using the "Add Plotter" application of AC. I've filtered paper sizes for the different printers. However, these filtered paper sizes are not the same for all workstations.
E.g. If I filter out all paper sizes and only check ISO A0 and ISO A1, on some of the workstations there are other paper sizes available. How do I avoid this from happening?
View 8 Replies
View Related
Oct 10, 2011
How to make PDF's which were made out of DWG"s less vague?
Same lines can come out looking good or vague. Sometime part of blocks appear vague while the other side appear good.
View 4 Replies
View Related
Nov 13, 2012
Using 2013, I have a drawing created in that other software ( Micro station). I opened it in autocad, and did some work to it.
View 2 Replies
View Related
Dec 20, 2012
I have created a batch routine that plots PDF’s of a list of drawings. Everything is working ok. It opens the drawing, turns on and off layers, and then plots to PDF. The plots come out fine, but after each plot, it opens the PDF. This would not be a problem for one or two drawings, but when doing a few hundred, it becomes quite frustrating.
I can see how to change this using the plot dialogue box, selecting DWG To PDF.pc3 and editing the custom properties. But no matter how many times I change it does not save, and will open the PDF.
I have found a work around by killing the process Acrobat.exe at the end of the plot. But is there a better way of doing this?
View 1 Replies
View Related
Jan 7, 2013
we modeled prototypes of trains (locomotives) in 3dsMax, these models will be used to produce molds and thumbnails of these, you must give the producer STP files, max does not export these files, and we have exported in various formats supported by some programs if exported STP, eg Inventor, we have exported files are STL, oBJ and DWG, so far so good, all save the parts or layers without problem.
The problem comes when exporting from Inventor to STP, nothing happens, the STP file is as if you were empty, there is nothing ..
I have attached the DWG file, if possible, have 17 CAD models for export to STP.
View 2 Replies
View Related
Jun 12, 2012
I downloaded the LT trial version with a new computer with Windows 7 Pro and LT keeps shutting down. If I close a file the whole program shuts down or sometimes it just randomly shuts down.
View 2 Replies
View Related
Aug 29, 2013
The purchasing group in my company need to batch plot autocad dwg files to pdf files to send to vendors. They do not have AutoCAD on their computers. I have done searches on the internet for programs, but I am leary of donwloading them. If I use the AtoCAD API in a program can I make it so they don't need AutoCAD to plot?
View 2 Replies
View Related
Feb 25, 2011
I have plotted to PDF before, but on this particular drawing I'm losing some part of the drawing.
Two viewports at different scales. The larger viewport (zoomed in) plots perfectly. The smaller viewport (zoomed out) only plots the CAD layer (green line), but does not plot the Shapefiles (green dots and gray lines). Shapefiles are on their own layer, that layer is turned on. These are the only three items in model space; the black text and arrows are in paper space on the layout tab and render correctly in the large viewport.
Is it a scale issue with the shapefiles in the small viewport or a plotting issue?
View 9 Replies
View Related
Mar 7, 2012
I can connect to jp2 aerials via FDO but the images do not come in. They work fine with raster insert, why not FDO?
View 3 Replies
View Related
Aug 20, 2011
Is it possible to take Current User Coordinate System of external Database object, like
Application.DocumentManager.MdiActiveDocument.Editor.CurrentUserCoordinateSystem?
View 7 Replies
View Related
Jul 9, 2013
I have upgraded my Adobe reader to XI and when converting DWG to PDF the files comes out very heavy (heavier than the DWG!) and all curved lines comes out very very light comparing to straight lines.
View 2 Replies
View Related
Jan 20, 2013
there is a problem with my code,when I load this dll,the toolbar‘s name can be fond in the customization dialog,but never shows in the UI(AutoCAD custom WS)。。。。It crush me up。。
[CommandMethod("AddToolBar")]
public void AddToolBar()
{
CustomizationSection cs = new CustomizationSection(
"C:\Users\Administrator\appdata\roaming\autodesk\autocad 2012 - simplified chinese\r18.2\chs\support\acad.cuix");
CAD.Document doc = CAD.Application.DocumentManager.MdiActiveDocument;
Toolbar newTb = new Toolbar("MyTool", cs.MenuGroup);
newTb.ToolbarVisible = ToolbarVisible.show;
[Code]...
i dont no y
i am a chinese,know little english.so it is hard for me to find codes of this aspect at this website,can u get me the link of the code?
View 2 Replies
View Related
Aug 30, 2011
I've been using the ado_lisp method to create a table and populate it from an access database with mixed results. Any VBA routine to create a table to share or a good source of information?
View 3 Replies
View Related
Jun 14, 2013
I am new to AutCAD and where I can find or purchase line tpes specific to development (i.e. water, san, storm, edge of payment, top of slope, etc).
I do not have time to learn how to make linetypes as I am still learning the basics of the program.
View 2 Replies
View Related
Feb 14, 2012
I have a 3 quilt patterns that need to be converted so that the quilt lady can upload it to her machine.
View 9 Replies
View Related
Nov 8, 2012
I would like to know how can i create or add an UOM. (for example : 25 per box) in my BOM.
View 1 Replies
View Related
May 24, 2011
How can I get the angle of a line as shown in the picture?
if (obj.GetType() == typeof(Line)) {
Line linha = (Line)obj; double angulo = linha.Angle;
Point3d startPoint = linha.StartPoint; Point3d endPoint = linha.EndPoint; }
For in my code I techo angle value in double. Could any method return the integer value of the angle?
View 8 Replies
View Related
May 17, 2012
The text on all my drawings is missing and i can't add any text.
View 9 Replies
View Related
Oct 18, 2011
I am using AutoCAD LT and I have drawn up something that we were hoping on putting in out GIS system (ArcGIS).
I have been told that my dwg file is not importing into the program. We have tried many conversion programs normally used and it is not working.
Is AutoCAD LT compatible with GIS?
View 5 Replies
View Related