AutoCAD .NET :: How To Stop Changing Active Document
Jan 24, 2013
How can I stop changing active document? I was thinking I could use this, but I don't know how to cancel it in the event handler:
AcadApp.DocumentManager.DocumentToBeActivated += new DocumentCollectionEventHandler(DocumentManager_DocumentToBeActivated);static void DocumentManager_DocumentToBeActivated(object sender, DocumentCollectionEventArgs e){ // Messagebox to ask if user are sure bool AreYouSureYouWantToChangeActiveFile = MessageBox.... if(!AreYouSureYouWantToChangeActiveFile) //cancel change active file somehow...???}
View 6 Replies
ADVERTISEMENT
Jan 5, 2014
I would like to turn off all the existing layers in active document. I have found in developer's guide how to turn off one layer with specified layer name but can not apply it on all layers with any layername.
I tried to get all the Object ID's in layer table and then for each object turn layer off but seems that it does not work.
<CommandMethod("FilterLayers")> _Public Sub FilterLayers()'' Get the current document and databaseDim acDoc As Document = Application.DocumentManager.MdiActiveDocumentDim acCurDb As Database = acDoc.Database'' Start a transactionUsing acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()'' Open the Layer table for readDim LayerTable As LayerTable = acTrans.GetObject(acCurDb.LayerTableId, OpenMode.ForRead)Dim LayerTableRecord As LayerTableRecord = acTrans.GetObject(LayerTable.ObjectId, OpenMode.ForWrite)For Each ObjectId In LayerTableLayerTableRecord.IsOff = TrueNext'' Save the changes and dispose of the transactionacTrans.Commit()End UsingEnd Sub
View 3 Replies
View Related
Jul 30, 2012
I write plug-in for AutoCAD in C# and I have a question. How I can change dws-file in active document?
I know how it's doing in LISP, but not in C#.
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
Jul 22, 2012
I have an external drawing processor and one of the functions is to read the layers in an AutoCAd drawing and if the name matches freeze/thaw it. With modifications over the years I have had it working with 2002 through 2008. Now I'm getting errors. When I tru to use the Interop, I get "Call Rejected by Callee" errors, when I use the
ApplicationServices method to get the application and active document, I getI" Method 'GetEnumerator' in type 'Autodesk.AutoCAD.DatabaseServices.LayerTable' from assembly 'Acdbmgd, Version=18.2.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation." errors.
Basically for the interop method I use this
Imports Autodesk.AutoCAD.Interop Public Function GetAcadApp() As AcadApplication Dim progID As String = My.Settings.strAcadProgID Dim acApp As AcadApplication =
[Code]......
View 2 Replies
View Related
Sep 20, 2012
I'm trying to change the active document window size with vb.net. This seems like it should be straightforward, but I'm having some trouble. Below is some code that I tried to use which I found on the AutoCAD DevBlog.. I thought I understood how this works, but I can't seem to import the correct references to make it work.
Dim doc As Document = Application.DocumentManager.MdiActiveDocument()
Dim docWindow As Window = doc.Window
Dim size As Size = docWindow.Size
docWindow.WindowState = Window.State.Normal
docWindow.Size = New Size(500, 500)
View 4 Replies
View Related
Oct 22, 2012
I'm trying to get the value of the Category iproperty of the model on the active drawing sheet. This is not a problem in a single sheet drawing, but I'm not sure how to specifically retrieve the Referenced Document of the Active Sheet in s multi sheet drawing.
Here's what I have:
Option Explicit
Public Sub PartsListFilter()
'set reference to the drawing document
'assumes that a drawing is active
Dim oDraw As DrawingDocument
Set oDraw = ThisApplication.ActiveDocument
[code]........
View 1 Replies
View Related
Mar 20, 2013
I'm not sure what I did to make this happen or how to change it back, but for some reason when I change the size of an object/line it changes the stroke weight as well. (For example, if I drew an ellipse with stroke weight 2 pt, and then increased the size the stroke weight would be 2.856 pt or some such number instead of 2 pt.) How to change this back?
View 3 Replies
View Related
Sep 3, 2013
Have been working on a little something and would like to know what units the user is using in their document. Basically what is selected here:
The thing is, no matter what is there (and while all other menus and such use the units) Active Document.unit stubbornly returns inches. Is there a way to get the proper ones using VBA?
View 3 Replies
View Related
Dec 16, 2008
I'm new to the style library and how to take an existing drawing that was created on one standard, and changing it to another standard I just created. The new standard has different dimension styles, text, and layers. I've added all the styles to my style library and I've set the new standard to the active standard in both the styles and standards editor and the document settings. If I create a new view, it comes in on the new standard, but the existing views are still on the old. How to I get the existing views on the new standard?
View 2 Replies
View Related
Jul 12, 2012
I'm looking for an API function that would allow me to change the active (or default?) row in the table of an iPartFactory model. I was hoping that such a function would be member or property of the iPartFactory object, but I’m not finding that to be the case.
View 4 Replies
View Related
Sep 27, 2013
Is there a script to convert a layer or layer group to a 32-bit image rather then the entire active document at present that is the only option in Ps 5.x.
View 4 Replies
View Related
Sep 30, 2013
I would like to make the active layer name the same as the document name. I know very little about scripting. I found this script:
var idoc = app.activeDocument;var ilayer = idoc.activeLayer;var filename = idoc.name;ilayer.name = filename;
It does almost what I need it to do. except that it also copies the ".ai" in to the layer name. Is there some way to modify this script to have it exclude or delete the file extension?
View 4 Replies
View Related
Feb 15, 2014
Apparently, in the CS3 is impossible to do any scripting and using any actions. Can it be done using plugins sdk, without creating a new document? I tried using the functions SetPageSetup and SetCropBox but no effect
View 6 Replies
View Related
Oct 24, 2011
Is it possible to get the list of all the fonts and colors used in the active illustrator document (.ai file) ?
if yes then how?
View 6 Replies
View Related
Mar 16, 2014
We need a script that select all pattern objects in the active document in illustrator.
View 5 Replies
View Related
Jul 31, 2012
I have a PDF underlay that is giving me some issues. I locked the layer and moved the pdf underlay's x-position to -1 and sent the drawing to the back to make sure it stays underneath all my lines, but annoyingly, everytime I draw something, it ends up *under* the PDF and I have to zoom out very far and selected the pdf to "send to back" again.
View 1 Replies
View Related
Apr 9, 2012
When I move my cursor over a document tab that is too short to show the whole file name, a pop-up appears with the full file name. The pop-up covers most of the tab, making it harder to click on it. I'd like to turn off this feature. I don't see anything in Preferences to do that.
View 4 Replies
View Related
Mar 30, 2013
Everytime I click on the sketch button/icon inventor changes my view and rotates / re-angles my view. When I'm make those narrow sketches inventor messes up my view.
How to stop this.. I'm guessing settings of course but which ones exactly if you've done this and what are the down sides to turning this off?
View 2 Replies
View Related
Jul 22, 2013
How do I get my text from my TextBox1 (add text) by pressing my CommandButton1 (okay) to my active page or document?
View 1 Replies
View Related
Feb 21, 2013
I work as a production artist and go through tons of art sent in from clients each day. Is there any way to stop swatches from copying from one document to the other? They build up and cause the program to lag or crash.
View 2 Replies
View Related
Oct 19, 2012
is there a way to stop ribbon from changing all those icons whenever you clicking on an object? because my computer at work is a bit slow and each click like that on a large civil 3d profile has a slight delay which that time adds up to reduced productivities. and i am clicking 500 times a day since there are 500 vertices to modifiy on say this alignment.
everytime you click on an object the ribbon changes which takes up cpu time due to running a bunch of codes to populate the icons on the ribbon. tried closing ribbon doesn't work still have the delay when mouse click on an object to show the grips. oh well maybe it's showing the grip that's using the cpu. but how can you say for sure without turning one feature off at a time to test?
Civil 3D 2012
Work: Xeon W3503, 12GB, Quadro 2000, Dell P2211H x 2
Home: 3930k, 12GB, GTX 590, U3011, QX2710
View 5 Replies
View Related
Oct 20, 2012
Whenever I import photos the exposure and other settings are changed. I have resete every default setting I can find for any kind of preset.I tried to uninstall by dragging to the trash can (Mac OS) and reinstalled to try and clear the issue. Not sure this was the correct process as it didn't seem to wipe everything out. Don't know what setting got changed along the way. Just trying to get everything back to default so that my photos aren't arent manipulated before I can even get them to the develop module.
View 2 Replies
View Related
Sep 30, 2012
I am occasionally developing with ObjectARX 2013. The problem: A command being executed from a document needs to focus on another document. I am doing that as:
Application.DocumentManager.MdiActiveDocument = aGeneratedDrawing;
After this line, the focus is taken by the other document. But the command execution just stops without producing any visible error or catchable exception. Apparently, the document focus cannot be changed during execution of a command.
A solution: What worked in the end was displaying a .NET form inside the command, like:
Autodesk.AutoCAD.ApplicationServices.Application.ShowModelessDialog(aForm);
Then, performing the very same set of actions on a button click works flawlessly.
The question is: can using the form as a mediator be avoided? It is redundant there. I tried hooking to CommandEnded, executing the code as a separate command via Application.DocumentManager.MdiActiveDocument.SendStringToExecute, and also executing the code in a separate delayed thread. So far, only triggering the code via the form worked.
View 4 Replies
View Related
Nov 24, 2012
I am using PSE10 and I have just upgraded from lion to mountain lion 10.8.2. Previously when I clicked "write keyword tag and properties info to photo" it seemed to just do that. Since the upgrade to mountain lion when I click 'write keyword tag and properties info to photo" it also changes the date the photo was created to the date the info was written to the photo .
How I can get it to write the keyword info *without* changing the date the photo was created?
View 1 Replies
View Related
Dec 10, 2013
Having some trouble with the oppacity on my projects. As you can see from the screenshot, I've clearly clicked something because any text or images that I try to add to my project and set the oppacity at 0% - to then build over a few seconds to 100%, will not do this.Yet previous elements that I've added will.
Is there something I need to click to stop the new text and images from changing oppacity immediately. I want them to build over time - I can see that the added keyframe looks different also.
View 3 Replies
View Related
Mar 7, 2014
Since Edge only has rectangles and ellipses built in as available shapes, how to I/we work with polygon shapes and active mouseover areas INSIDE of these shapes and non-active mouseover areas OUTSIDE of the shapes?
Problem/symptom: when I import a polygon, be it any file format from from Photoshop or SVG from Illustrator, a rectangular border/background (transparent) gets applied, leading to this rectangle defining the mouseover area of the shape - and not the shape itself (be it a star or whatever).
WHAT I WANT: the very shape defines the mouseover area. How do I achieve this?? See examle below:
WHAT I DON'T WANT: how is is now:
View 4 Replies
View Related
Nov 18, 2005
I have uploaded a document in JPEG format.I want to change the contents of the document.Please let me know which is the simple way of doing it.
View 4 Replies
View Related
Oct 3, 2013
I have a photo 36" x 24". I have cropped to 18.5 x 12.5" yet the document size remained the same. Now when I go to print on 13" x 19" paper, only a portion prints because the photo is too big. I shouldn't have to "scale" as then I have no way of confirming that it really will print to the crop dimensions.
Since upgrading to CS6, I have had issues with how the crop is done. For example, why when I open a photo in CS6, the crop tool is already selected by default?
View 4 Replies
View Related
Jul 25, 2013
sometimes when trying to manually input the percent number for either layer opacity or image zoom, when I try to type a number I just get a DING sound and it wont allow me to do anything. It goes away after I click a bunch of random things, minimize photoshop and then open it up again. Why does it do this? All I do is click on the percent number, try to input a new number but it sometimes just doesn't allow me to do so. I check all around the document to see if there is anything going on that may interfere but I notice nothing. What is it trying to tell me when it just dings and refuses to change the numbers?
View 2 Replies
View Related
Nov 16, 2013
Basically I am making a new pattern of stars, so I created a 1000 by 1000 document, filled with black, added noise, then added an adjustment layer to thin out the noise and make it look like stars in space. It looks great!
How to save it without the effect changing. I tried flattening the image, and it messed up how I wanted it to look. I tried merging visible, that didn't work. I tried just saving it as a PNG, like I do with all my projects, but that didn't work. And defining a pattern did the exact same thing. I just want to have what I physically see on the screen save as is so I can use it with other things.
View 4 Replies
View Related