AutoCAD .NET :: Using Object Modified Event To Collect Moved Objects In Move Command
Nov 6, 2011
I am going to collect objectid's of the moved items in drawing after they moved to destination. So I wrote an event to monitor move command , by using object modified event handler. when I run below code for every entity it collects 2 object id. One before move and one after move. Is there any way to just collect object ids after they moved?
Class EVENTS
Dim MyDwg As Document = Application.DocumentManager.MdiActiveDocument
Dim Myed As Editor = MyDwg.Editor
Dim Mydb As Database = MyDwg.Database
Dim Myobjidcoll As ObjectIdCollection
In my plug-in I have some datagridview to show alignment data of all alignments in drawing.
I have a button called (regen) to update data in these datagridviews. I read again database drawing and re-source again datagridview. (method "upload_all")
I have read some posts and blogs about this: [URL] ....
and about overrule: [URL] ....
But I don´t understand almost.
I only want to execute method "upload_all" if some alignment is modified in the drawing.
Also, I would like to do it if some alignment is just created or deleted.
Autocad Civil 3D 2014 +SP1 Quad Core Intel i7 3770-cpu 3.40Ghz. ssd samsung 840 pro 512gb+ssd samsung 840 pro 256 gb+1tb hdd 32gb RAM 1600 Mhz. nVidia Quadro 2000. Win 7 Pro 64bit
I have a group of classes that essentially implement the Model View Controller pattern. The view is a custom control contained in a PaletteSet. The Model is a class that wraps the ObjectID of a given block. I've used these classes to create a replacement for the Properties tool in AutoCAD (2011). Basically the UI can be used to edit the properties of a Dynamic Block. But I apply my own rules and behaviors to the UI.
I had no problems until I added support for the View to be updated when the block is modified (say by dragging to increase a length property). To do this I handle the Modified event of the block. After the block is modified, some rules are evaluated. If the rules result in changes to the block's properties, these changes are applied. This last part is where I'm having trouble.
When the "Rule Evaluation" code is invoked because of changes to the view (WinForms Controls), I am able to update the block's Properties using the following code without issue:
Public Shared Function SetParameter(ByVal BlockID As ObjectId, ByVal ParameterName As String, ByVal Value As Double) As Boolean Using dl As DocumentLock = Application.DocumentManager.MdiActiveDocument.LockDocument(DocumentLockMode.ProtectedAutoWrite, Nothing, Nothing, True) Using myTrans As Transaction = BlockID.Database.TransactionManager.StartTransaction Dim myBRef As BlockReference = BlockID.GetObject(OpenMode.ForWrite) For Each myDynamProp As DynamicBlockReferenceProperty In myBRef.DynamicBlockReferencePropertyCollection If myDynamProp.PropertyName.Equals(ParameterName, StringComparison.OrdinalIgnoreCase) Then myDynamProp.Value = Value myTrans.Commit() Return True End If Next Return False End Using End Using End Function
However, when this same code is invoked as a result of the BlockReference Modified event, AutoCAD completely crashes the momment the transaction.Commit() method is called. I've attempted to catch the exception causing the crash and role back the transaction, but AutoCAD simply exits and displays the error (Error handler re-entered. Exiting now.) and no exception is caught. Note that I do not use the BlockReference instance passed to the Modified event handler. Instead I store an ObjectID instance elsewhere which is consistently used to read/write the block.
Is there something I must do before commiting a transaction when using the Modified event of BlockReference? I checked, and the same "Main Thread" is executing whether the code is invoked from a UI event or the Modified event. I tried calling the Close method, which is attributed as Obsolete, on the BlockReference object before executing the transaction without any success.
I am using AutoCAD Architecture 2011. I have been working in a drawing for several weeks on casework. I have multiple viewports on my sheet layouts. Up until now I was able to select the viewports and move them or make them bigger or smaller with grip edit but now although I see them I can't select them or even delete them. I can double click within the viewport and change the scale or modify the items in the viewport but I can't do anything to the viewport in paper space.
I have turned all the layers on and made sure that none of them were locked. I have tried regen. I have opened a new tab and tried to create new viewports and I have the same problem. I can create them but once I do I can't modify / move them.
Beyond that when I switch from model to paper space it takes about 5 min. sometimes longer to switch and the same thing when I save it or close it. Is that normal?
I am having an issue running AutoCAD LT 2011 on a Windows 7 Pro 64-bit. If I have orthographic dimensions on the drawing, AutoCAD crashes if I try to move, modify, or delete the dimensions. Recovery does not work. I am stuck with the dimensions once they are placed because if I touch them, the program crashes.
I do not know if this is important but I will include it anyway: this does not happen with older drawings that were created under older versions of AutoCAD LT. It only happens with ortho dimensions created in LT 2011.
I have applied all the latest patches, drivers for the video card, and even tried opening the drawings in 32-bit mode. Nothing seems to work.
My system is a Dell Precision T3500 Windows 7 Professional SP1 64-bitIntel Xeon Dual Core 2.53GHz cpu12GB ramNvidia Quadro 4000 running Nvidia driver version 265.70
Before I upgraded to AutoCAD 2014 (was using 2012) when I used the MOVE command on 3D geometry (while using the Realistic Visualization) I could see one object move into another. Like, moving a cylinder into a box to represent a button, and I would see it slowly sink into the box as I moved it further and further along.
In 2014, the object I am moving will REMAIN ON TOP visually of all other geometry until it is completely inside the other geometry (at which point it disappears completely). It's hard for me to then judge just how much of it is sticking out during the MOVE command. Once I complete the move command, the proper visualization order is then shown.
In other words, if I have a 10 inch cylinder, and I'm trying to move it into a box so only 2 inches sticks out (as a visual guesstimation), currently I would see ALL 10 inches of the cylinder whether part of it is inside the box or not, until I complete the MOVE command.
I want to put type on a perfect circular path.But first I need to stretch the type so it is longer vertically.Stretching type and using it as normal is easy.But how in the world do I use the stretched type on a path?
I use Acad and Turbocad selectively. I can't find a way to enable Acad to have object handlers to move and rotate objects. Is there a setting that I can enable to turn this feature on in Acad? I like this feature in Turbocad, but like to have in Acad.
I constantly run into the problem that I have many objects and when I want to drag the selected object to move it around, the object laying in front / or on top of it will be grabbed and moved instead. How do I shortcutwise avoid to pick an unwanted object when I'm about to drag an object ? Is there something like a key to hold, so that Illustrator understands that I want to move the already selected object only ? Since that is a 100 times per day task and I can't always lock and unlock all other layer I'm working on too ... well I could, but that would slow down working 100 times since it's not easy to identify / switch on of each layer in the layer list each time i pick another object ...
If a window is tagged and the window is moved, then the tag moves also. Is it possible to keep the link to the property set information but make it so the tag does not move if the window is moved?
I don't understand why the right click - open drawing command had to be put in a submenu. Is there a way to customize the commands on these right click menus other than the marking menu? I don't really like the marking menu, and I don't want to put it there. There was nothing wrong with where it was... There are so many commands in the basic right click menu that a good majority of inventor users don't use. At least give us the ability to customize this.
When I switch the display mode from "Wireframe" to "Realistic" or "Shaded" a strange thing happens.Whenever I make a change (say, position, size or color), the change can't be seen in real time. I have to use my middle button to either zoom or move my point of view, and then the viewport snaps to the change I made.
Also, when I change the color of the object, it takes very long (and in a fade in way) to turn to the desired color. Here again, I have to move around the object to see the real change take effect.How do I fix this so that I see the changes in real time?
Is it possible to write an event handler for an autocad event/ command like insert new block? I want the event to trigger the execution of an update routine . something like this post
i am trying to make a custom palette to display some custom information pulled out from selected objects.i can deal with the palette part.
i want some code for when you click an object in model space then the property palette updates. i am gonna keep it simple so this custom palette only refresh to the last selected object. but i don't know how to make an event when mouse click the autocad object and then do my things. any codes in c# or vb.net would be nice.
so use commandmethod load in a command and there will be a palette there stay open, when user click on an object then it will get populated. what event do i use for the clicking?
I do my 3D modeling by use of simple cylinders,boxes and everything looks fine. but when I re-open the file just minutes later lots of objects has moved. See attachment. The attached picture shows a highlighted cylinder that is BOTH highlighted inside the module (where it is supposed to be) and on the outside where it has moved.
This happens all the time and I have to move the objects back in position. The distance the objects are moved is random. I use 'acadiso3D' template for these models
I am developing a .NET application that integrates with AutoCAD Architecture. In my .NET application, I provide my user with a list of drawing files (.dwg) that they can choose to open. Once my user has selected a file, my application will open the selected drawing in AutoCAD Architecture. In this drawing, the user can click on an object in the drawing.
Can this mouse click event be captured and the object ID for the selected object be returned to my application?
Somehow the objects of my dynamic block have moved away from the original basepoint.
I can't simply edit the block and move all the objects back to 0,0 because then I have to re-do all the stretch commands since the stretch windows don't move.
I have a basepoint parameter but it doesn't seem to be working.
I would of thought that changing the justify location to an object would change its position when copy and paste...
i copy and paste ALLOT, when i do i utilize reference points so everything is uniform.. problem is not everything is the same size.. for example, if i have 2 lines in a text box verses one...
When i copy i want the object to be moved and snapped from the middle left, not bottom left... or the top right not the bottom left.
I just upgraded to PSE 12. So now all my organisation folders are under the "keyword" tag. And I have a lot of them. Of course they are organized in folder/subfolders. And the main ones are "places" "events". The same as the default ones in pse.
So is it possible to move categories/directories from the keyword tag to event/place/people tags (drag and drop doesn't work).
I have a marker on a cross section that was projected from a short feature line that I created from a 3DPolyline. If I move the cross section (they never come in correctly, right?), the feature line moves too. If I use a 3Dpoly, this doesn't happen. Only went to the feature line because for some reason, when I went to Project Multiple, the 3Dpolys weren't picked up.
Now I wondering if I've moved feature lines on other projects where I have moved the sections. Could be a real problem. Most of those, though, had a mix of feature lines and 3Dpolys, so they would only be partially messed up! Hopefully, I moved the sections before doing the projection.
When i copy an artboard, sometimes the objects on both the original and the duplicate artboard have slightly moved. See sreenshots below what i mean (you have to look closely).
The right artboard was copied to the left by alt-dragging the artboard. This happens to me a lot, but not all the time, i can't really predict when it happens... At first i thought it came by an accidental mouse click or something, but the strange thing is that after the copy the objects slightly moved on both artboards.
So a friend created a model using zbrush and exported several different *.OBJ files. I imported those to maya and added shaders. They all fit correctly together when imported.
some of those obj files required me to do a mesh->combine. so now it appears that not every item has the same reference point so that when I move or scale the entire item, some of the objects move seperately. I think it is only the ones I had to combine.
I tried freeze transformations, but when doing that, some of the objects lost their scale settings and still didnt move together as one unit.
I have a button which has a mousover/mousout animation. When i click the button, it will shrink down to 0%. when it does, my mousout event is triggert, which i dont want.
how can i disable the mousout event after the click event?
What happened to the option/enter command in the move object dialog that has been around since the early days of Illustrator??? Instead of having to mouse click the "copy" button in the move object window, one could just hold down option with Return or Enter and the Copy command would happen rather than a simple move. Immensely useful for prepress work!
I just got AUTOCAD 2013 and I have problem using MOVE command. With my previous version AUTOCAD I was able to move one by one every line from the object I created. Now with the new version when I use MOVE command, not only one line is moved, it is moved the whole object (Like the object is a block, but is not).
How can I move only one single object from my drawing?
Having never used this command before I am struggling as to where it is located.I imported a U-Bolt in Solidworks format and I am just trying to move the nuts as indicated.
Whenever I use the move command on a line or series of lines that are touching other lines, the lines that aren't part of my selection move with that one line. cad-movecommand.jpg Here's a series of screenshots showing what I mean. I can't move just that line without moving the other lines around it.
I'm want to drag an objects anchor and have the position co-ordinates offset by opposite amounts so it doesn't appear to move postioin on screen. IS there a tool for that?