Jump to content

Recommended Posts

Posted

Hello All,

I think this is an easy one just need a little light on the path......

 

I want to highlight AND show the grips of the items in my active selection set, here is where I am at:attachment.php?attachmentid=8552&stc=1&d=1228236900

 

 

 
Set sset = ThisDrawing.SelectionSets.Add("SS1")
   mode = acSelectionSetLast
   sset.Select mode
   ThisDrawing.SendCommand ("_grips" & vbCr & "1" & vbCr)
   sset.Highlight True

highlightmouse.JPG

Posted

From the AutoCAD help file example:

 

DisplayGrips Example [ActiveX and VBA Reference: AAR]Sub Example_DisplayGrips()     ' This example reads and modifies the preference value that controls     ' the display of selection set grips for the Stretch, Move, Rotate,     ' Scale, and Mirror grip modes.     ' When finished, this example resets the preference value back to     ' its original value.          Dim ACADPref As AcadPreferencesSelection     Dim originalValue As Variant, newValue As Variant          ' Get the selection preferences object     Set ACADPref = ThisDrawing.Application.preferences.Selection          ' Read and display the original value     originalValue = ACADPref.DisplayGrips     MsgBox "The DisplayGrips preference is set to: " & originalValue      ' Modify the DisplayGrips preference by toggling the value     ACADPref.DisplayGrips = Not (originalValue)     newValue = ACADPref.DisplayGrips     MsgBox "The DisplayGrips preference has been set to: " & newValue      ' Reset the preference back to its original value     '     ' * Note: Comment out this last section to leave the change to     '         this preference in effect     ACADPref.DisplayGrips = originalValue     MsgBox "The DisplayGrips preference was reset back to: " & originalValue End Sub   

Posted

I tried this using the example code > put a watch on the preferences > displaygrips value was defaulted to "true" > then I tried toggling it on and off, walking through the code, line by line, watching the displaygrips value change etc using this sample code still no go. Any ideas?

thx

  • 4 years later...
Posted

To show grips you must call SELECT command in AutoCAD Prompt and then pass from VBA to Prompt entities using Lisp handent function.

We have some smaples in http://www.abccorsicad.it/software_autocad.html but basically you have not to download and install these plugins to read (opensource) code: just try this:

'select all lines of your drawing with grips

Public Sub test()

Dim c As Collection, obj As AcadEntity

Set c = New Collection

For Each obj In ThisDrawing.ModelSpace

If TypeOf obj Is AcadLine Then

c.Add obj

End If

Next

SetSelection c

End Sub

 

Private Sub SetSelection(objs As Collection)

Dim obj

If ThisDrawing.PickfirstSelectionSet.Count > 0 Then

'just send any command to remove grips

ThisDrawing.SendCommand Chr(27)

End If

ThisDrawing.SendCommand "_SELECT" & Chr(13)

For Each obj In objs

ThisDrawing.SendCommand "(handent """ & obj.Handle & """)" & vbCr

Next

ThisDrawing.SendCommand vbCr

End Sub

 

Hello All,

I think this is an easy one just need a little light on the path......

 

I want to highlight AND show the grips of the items in my active selection set, here is where I am at:attachment.php?attachmentid=8552&stc=1&d=1228236900

 

 
Set sset = ThisDrawing.SelectionSets.Add("SS1")
   mode = acSelectionSetLast
   sset.Select mode
   ThisDrawing.SendCommand ("_grips" & vbCr & "1" & vbCr)
   sset.Highlight True

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...