Stop user selecting block reference

Stop user selecting block reference

Anonymous
Not applicable
328 Views
2 Replies
Message 1 of 3

Stop user selecting block reference

Anonymous
Not applicable
Hi all,

In Brief:
What I want is to be able to stop a user selecting a block reference unless they use the button on my form.

In Full:
I have written an application which plots road traffic accidents which I have in an access database. I have created a block with a load of attributes which contain all the information about the accident. (The coordinates area also an attribute)

I have made it so that a user must click "move accidents" on a form in order to move the accident and this automatically updates the co-ordinate attribute.

What I want is to be able to stop a user selecting a block reference unless they use the button on my form.

Something along the lines of
thisAccident.selectable = false

I am not sure whether this is possible but I have looked all over and can not find the answer.

Thank you in advance

Jon
0 Likes
329 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
you could use the AcadDocument_SelectionChanged() event to check the selection and if it is a block, get the name... then if it has the correct name, deselect it.


http://www.resourcecad.com ~ for your CAD solutions
0 Likes
Message 3 of 3

Anonymous
Not applicable
this may get you started ~
Dim TheObj As AcadEntity
If ThisDrawing.PickfirstSelectionSet.Count > 0 Then
Set TheObj = ThisDrawing.PickfirstSelectionSet.Item(0)
If TheObj.ObjectName = "AcDbBlockReference" Then
If TheObj.Name = "ThatBlock" Then
TheObj.Highlight (False)
MsgBox "Dont' touch me !"
End If
End If
End If

http://www.resourcecad.com ~ for your CAD solutions
0 Likes