AutoCAD .NET :: Editor Selection Added Event
May 31, 2011
I am trying to get a list of selected entities and their layers, but I want to capture it from the editor, not a command.
I currently have
Private Sub ed_SelectionAdded(ByVal sender As Object, ByVal e As Autodesk.AutoCAD.EditorInput.SelectionAddedEventArgs) Handles ed.SelectionAdded Try For Each objid As ObjectId In e.AddedObjects.GetObjectIds Using tr As Transaction = ed.Document.TransactionManager.StartTransaction Dim ent As Entity = tr.GetObject(objid, OpenMode.ForRead) ed.WriteMessage(vbLf & objid.ObjectClass.DxfName & " is on " & ent.Layer) End Using Next Catch ex As Autodesk.AutoCAD.Runtime.Exception End Try End Sub
but when select a circle on Layer 1, I get the result below in the command line
CIRCLE is on Layer1
CIRCLE is on Layer1
CIRCLE is on Layer1
CIRCLE is on Layer1
CIRCLE is on Layer1
CIRCLE is on Layer1
Command:
CIRCLE is on Layer1
If I hover over the circle while it is selected, it also treats it as a selection.
View 2 Replies
ADVERTISEMENT
Mar 24, 2013
Is there any Event when The enhanced properties editor dialogue show out? I want to do something when the dialogue is showing.
I first use the CommandWillStart Event to catch the "EATTEDIT" order ,however,if only covers the condition that users doubleClick the block .when users first input EATTEDIT command then select the block this event was wrong!
View 6 Replies
View Related
Aug 10, 2012
Looking for a way to add additional properties to the drop-down list in Rename Browser Nodes.
Standard List:
Filename
Part Number
Default
Additional properties would be a concatenation of native inventor properties:
<Part Number>-<Description>
View 5 Replies
View Related
Aug 2, 2013
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?
View 4 Replies
View Related
Sep 21, 2012
when I select objects in the block editor window I cannot see/autocad does not display (?) the selection fence.
AutoCAD Civil 3D 2012 x64 SP1 - Windows 7 Pro x64 SP1
Dell T3500 - Intel Xeon @ 3.2 gHz - 12 GB ram - Nvidia Quadro 4000
View 2 Replies
View Related
Aug 5, 2011
I am having a problem with selecting polys (or edges for that matter) while working in the UV editor. When I draw a marquee around an entire object, my selection is not selection some polys either on the top, bottom, or on the back side of the object. The same thing happens when I use a marquee to subtract from a section. This happens both when selecting in the viewport (when the unwrap uvw modifier is active) and in the UV editor. My selection are working as they should when I am not in the modifier.
I just discovered that there is an ignore backfacing setting in the UV editor, which I, of course, had active.
View 3 Replies
View Related
Dec 12, 2013
When I save a selection in the family editor I can't seem to find the load selection button on the manage tab like you would in the project environment. The whole panel selection is not there. If I make a selection of at least two elements I get the load selection button on the modify tab. Is this as design or as forgotten?
At this moment it seems I first have to make a selection in order to load another selection.
[URL].....
and
[URL].......
View 1 Replies
View Related
May 3, 2013
I'm having difficulty placing a pattern type on my materials. When I select the pattern from the list that pops up and I click "OK," the pattern selector pops back up and won't let me exit. I think that if I go back to my original pattern, it will go away. I've tried restarting Revit and various other matierals in other projects on different types of families in both the surface and cut pattern prompts.How do I chage my patterns?
View 5 Replies
View Related
Apr 14, 2012
I'm trying to connect. On the inputs, I'm loading the control curve, on the outputs, the cluster.
I'm trying to connect the translate values.
However, it doesn't allow me to select the input first. I can select the output first, but that puts the connection backwards.
I don't see why a control curve can't be connected to a cluster? Or is something wrong with my Connection Editor?
View 1 Replies
View Related
Mar 13, 2012
We've just started using an attribute in a dynamic block and I'm curious if there is a faster way to edit the text, like how you just click outside the dtext or mtext editor to save and exit. the editor.
We only need to edit the value field, not any of the other attritubes. I really like how the dynamic block is saving us some time, but the outdated editor is really irritating, and it's not always convenient to hit Tab then Enter on the keyboard.
Is there perhaps an alternate editor, or a way I can edit the value text in the mtext editor by default rather than opening up the Enhanced Attribute Editor?
System specifications: AutoCAD 2014 64-bit SP1, Windows 7 64-bit SP1, Intel Core i7-2600K, AMD FirePro V4900
16GB RAM, Crucial M4 SSD, 3 Dell Monitors (2 30" 2560x1600 & 1 20" 1200x1600)
View 9 Replies
View Related
Dec 5, 2011
Private Sub ObjectModified(ByVal sender AsObject, ByVal e As Autodesk.AutoCAD.DatabaseServices.ObjectEventArgs)
With e.DBObject
If .IsWriteEnabled Then Exit Sub
If .Id.ObjectClass.Name = "AcDbAttribute"Then
?????
End If
End With
End Sub
Trying to read the attribute's tag and text.
View 2 Replies
View Related
Nov 29, 2013
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
View 1 Replies
View Related
Mar 31, 2013
Is there any Event or ApI to get the Point3D when the mouse is moving using .net
I want to get Point3D when the mouse is moving just as CAD shown on lower left corner. Is there any way to get it with .net?
View 2 Replies
View Related
Jul 17, 2013
I want to catch drawing modify event, that means if user start to edit current document I want to give a message to user.
View 3 Replies
View Related
Jun 15, 2011
why does the DocumentCreated-Event fired two times. Thats a problem because the code within the event-method must only execute one time.
View 2 Replies
View Related
Jul 9, 2012
There is an event at the show of multiselect ribbontab on Civil3D?
View 4 Replies
View Related
Dec 11, 2012
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.
View 3 Replies
View Related
Dec 8, 2011
Is there any chance to define an event trigger which runs an iLogic rule when we check out an already open file? Problem is, that we need to synchronize iProperties on check out to clear "Approved by" when Vault State of Part is "under revision"
Vault Parameter "State" is mapped with iProperty "State".
So I want to run the following on check out:
Call ThisApplication.CommandManager.ControlDefinitions.Item("VaultPropertyWriteBack").Execute2(True)
View 3 Replies
View Related
Aug 20, 2012
I would like to automatically wire up the event handlers for my .net assembly when it is loaded. For instance, does AutoCAD look for and call a "Loaded" or "Initialized" event when it loads my DLL?
View 1 Replies
View Related
Nov 11, 2011
I have addin running inside Inventor. The requirement is that addin should be able to capture the "save as" operation done by the user. Internally, addin stores unique information in the active Inventor file and when user does "Save as", it needs to generate and store the new unique information in the newly created file after Save As. That is the reason it is required to capture the Save As event.
It was possible to capture the "Save" event and there I get Event Timing Enum (kBefore and kAfter). But the file name is same for kBefore and kAfter. So its not possible to identify that its Save As operation.
View 3 Replies
View Related
Sep 9, 2013
In order to avoid duplicate event handlers, I did like the following...
Document doc = Application.DocumentManager.MdiActiveDocument;try { doc.BeginDocumentClose -= new DocumentBeginCloseEventHandler(MyEventHandler); }catch { // Do nothing }doc.BeginDocumentClose += new DocumentBeginCloseEventHandler(MyEventHandler);
The above worked greatly with AutoCAD 2007. But yesterday I migrated my code into AutoCAD 2010 (with Object ARX 2010).
Unfortunately, it seems like AutoCAD 2010 catches before my code catches it. I guess I could just have a global boolean value that checks the status of event attachment.
View 7 Replies
View Related
Feb 8, 2012
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?
View 4 Replies
View Related
Oct 1, 2013
I'm trying to create a handler for the OnDocumentChange Application event.
private Inventor.Application m_inventorApplication;
Inventor.ApplicationEvents appEvents = null;
public StandardAddInServer()
[Code]...
My OnSaveDocument handler works just fine but the OnDocumentChange will not fire. I've been using the even watcher and have been using other handlers but cannot seem to get this one to work.
View 7 Replies
View Related
Nov 16, 2011
I'm trying to react to the AutoCAD application window being resized, that reaction is to move a form so that it stays in the bottom right hand corner of the AutoCAD application window. However, I cant seem to find a way to react to an AutoCAD application window resize event.
View 1 Replies
View Related
Jun 5, 2013
Trying to catch an export PDF event.
Few things I have tried...
UserInputEvents.OnActivateCommand
ApplicationEvents.OnSaveDocument
FileUIEvents.OnFileSaveAsDialog
Can't find any reference to export events.
Inventor 2014
View 2 Replies
View Related
Nov 26, 2012
Displaying a vb.net form when an autocad block reference is double-clicked. Unfortunately, I still don`t know how to capture the double-click event for a block reference from code. I have gone down the IMessageFilter path, still no success.
I have tried the addHandler for application using code supplied to me in my previous post, still no luck. I really need to be able to capture the double click event for a block reference in autocad, without overwriting the default autocad double-click behavior.
I wish to be able to double-click a block reference, capture its name, and, if the name is same as blocks created by my form, then I`d simply have my dot net form pop up, displaying a few of the block`s properties.
Below is the code module I am using, which isn`t working ofr me:
' System
Imports Microsoft.Win32
Imports System.Reflection
' AutoCAD
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.Runtime
Imports acApp = Autodesk.AutoCAD.ApplicationServices.Application
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.EditorInput
[code].......
And the Commands class, from which my vb.net form is generated, as well as where the ModDoubleClick.eventDoubleClick() method is called:
Public Class Commands
' Component for displaying the Mass Straight Conveyor form
<CommandMethod("mst")> _
Public Shared Sub massStraight()
Try
' Call this to override default block dblclk event handler
[code].......
View 9 Replies
View Related
Aug 3, 2012
How can I log in a file the start and close event of Autocad?
View 1 Replies
View Related
Jan 1, 2013
I saw one video in which a Photoshop geek quickly launces his raw editor by clicking on a small, illegible icon in the lower right-hand of his Layer Icon in his Layers Dialogue but of course he doesn't explain how that works, and there is no such corresponding little sub-icon in MY Layers icon, and the word Raw doesn't even seem to show up anywhere in any menu. I know this has to be possible. I can open a raw file (.nef, in this case) the obvious way, but after switching it over to Photoshop I can't switch it back to the raw editor (?)
View 2 Replies
View Related
Apr 30, 2012
I have the right click on autocad for repeat the last command.
when i launch my prog. --> the prog show a form with a datagridview. I have added a contextMenuStrip in this datagridview.
SO when i launch the prog with the right click (repeat last command) the form show and the contextmenustrip too. (if the mouse is on the datagrid.)
How i can cancel or purge the event mouse right click ?
View 7 Replies
View Related
May 15, 2011
I am currently in the process of re-writing my VBA in .net.In VBA I successfully used AcadDocument_BeginClose which called lisp functions.It would be nice to have all code in the same environment I need to transition my changes.
Therefore I need to call lisp from .net.My function works well when run withing the cad files session but does not appear to call the lisp when called after the BeginDocumentClose.
Is it possible to call a lisp function after the BeginDocumentClose event?
View 1 Replies
View Related
Jul 25, 2011
I am using VB.net created a palette。 I need to call refresh drawing(my own function) when user close this palette. But I don't know which event I need to put my code in.
View 8 Replies
View Related