Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
cencinaNB2ET
480 Views, 2 Replies

How to Show Context Menus?

I need to right Click with code once i have the object selected from the browser in a drawing.

But i cant find the command to do this, Only how to add buttons but not to actually bring that menu up.

Any help would mean a lot.

Thanks.

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cencinaNB2ET
in reply to: cencinaNB2ET

Ok I have  Workaround in my case.

I knew that the curves I was tackling were all proxies and also I knew the object from which they came from.

So I just found them through Drawing curves...

 

 

 

 

Dim oCurve As DrawingCurve
Dim oColor As Color 
For Each oCurve In oView.DrawingCurves
If oCurve.ModelGeometry.Type = 83898992 Or oCurve.ModelGeometry.Type = 83896176 Then
'MessageBox.Show(oCurve.ModelGeometry.ContainingOccurrence.Definition.Document.DisplayName)
String_1 = oCurve.ModelGeometry.ContainingOccurrence.Definition.Document.DisplayName
If InStr(String_1,"SIA") > 0 Then
oColor = ThisApplication.TransientObjects.CreateColor(0, 255, 0)
oCurve.Color = oColor
oCurve.LineType = LineTypeEnum.kContinuousLineType
oCurve.LineWeight = 2
ElseIf InStr(String_1,"GIA") > 0 Then
oColor = ThisApplication.TransientObjects.CreateColor(255, 0, 0)
oCurve.Color = oColor
oCurve.LineType = LineTypeEnum.kContinuousLineType
oCurve.LineWeight = 2
End If
End If
Next

 

WCrihfield
in reply to: cencinaNB2ET

So...do you still need help?

If you need to make a manual (by mouse click) selection to go with your iLogic code, there are a couple popular options.

You can use oDoc.SelectSet

at the beginning of your code.

That captures your existing selection, from before you started the code, into an ObjectCollection.

You can also use the following line, but just change the selection filter and object type to suit your needs:

Dim oObj As Object = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllEntities,"Select an Entity")

Wesley Crihfield

EESignature

(Not an Autodesk Employee)