Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4331

[VBA] PowerInroads SS10 How does one locate an element that is a member of a graphics group?

$
0
0

Hi,

I wrote a progam that creates a graphics group and I would like to write a program to delete a member of the graphics group without disturbing the rest of the graphics group.  The graphics group is special in that it has tags and some of the members have tags, so I don't want to just drop it, delete the element and group the remaining elements.  So i'm trying to write an ILocates to do this, but I think I'm approaching it wrong.  See my code so far.  When you pick on an element in the graphics group, the whole group highlights.  How do I pick just the member of the group, and once I do that, how do I find the group it is part of? I tried to delete all the extraneous code, hopefully I didn't break it.

Option Explicit
Implements ILocateCommandEvents
Dim DeleteEl As Element
Dim myLC As LocateCriteria

Private Sub ILocateCommandEvents_Accept(ByVal Element As Element, Point As Point3d, ByVal View As View)
   'DELETE ELEMENT HERE
End Sub

Private Sub ILocateCommandEvents_Cleanup()
End Sub

Private Sub ILocateCommandEvents_Dynamics(Point As Point3d, ByVal View As View, ByVal DrawMode As MsdDrawingMode)
End Sub

Private Sub ILocateCommandEvents_LocateFailed()
End Sub

Private Sub ILocateCommandEvents_LocateFilter(ByVal Element As Element, Point As Point3d, Accepted As Boolean)
'INITIALIZE FLAG
   Accepted = False
   If Element.Type = msdElementTypeCellHeader Then
      Set DeleteEl = CommandState.GetLocatedElement(False)
      Accepted = True      
   End If

End Sub

Private Sub ILocateCommandEvents_LocateReset()
'QUIT
   CommandState.StartDefaultCommand
End Sub

Private Sub ILocateCommandEvents_Start()
   Set myLC = CommandState.CreateLocateCriteria(False)
   CommandState.SetLocateCriteria myLC
   myLC.IncludeType msdElementTypeCellHeader
   CommandState.EnableAccuSnap
   ShowCommand "Test"
   ShowPrompt "Pick element to delete"
End Sub

Thanks,

Minion


Viewing all articles
Browse latest Browse all 4331

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>