• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Visual Basic Customization

    Reply
    *Lie, Trond Hasse

    Select Object/Show grips - via Code

    149 Views, 6 Replies
    08-14-2000 11:45 AM
    Hi.

    I was just wondering if anyone know how I can use VBA to select objects in
    the drawing, so that the grips are enabeled/shown. The editing of the object
    will be done manually in AutoCAD. All I want for VBA to do, is to select
    them.

    Trond Hasse Lie
    Norway
    Please use plain text.
    *Oquendo, Frank

    Re: Select Object/Show grips - via Code

    08-14-2000 03:30 PM in reply to: *Lie, Trond Hasse
    Without the aid of a third party program (perhaps Tony T's AcadX), this is
    not possible from VB/VBA since the correpsonding property
    (PickFirstSelectionSet) is read-only. In my attempts to use the LISP
    function SSSETFIRST, the grips were cleared as soon as the VBA macro
    completed.

    --
    Attitudes are contagious. Is yours worth catching?
    http://www.acadx.com

    Trond Hasse Lie wrote in message
    news:817B28F9FF0CC96661FEFFA0E9C3AD8E@in.WebX.SaUCah8kaAW...
    > Hi.
    >
    > I was just wondering if anyone know how I can use VBA to select objects in
    > the drawing, so that the grips are enabeled/shown. The editing of the
    object
    > will be done manually in AutoCAD. All I want for VBA to do, is to select
    > them.
    >
    > Trond Hasse Lie
    > Norway
    >
    Please use plain text.
    *Tanzillo, Tony

    Re: Select Object/Show grips - via Code

    08-15-2000 12:07 AM in reply to: *Lie, Trond Hasse
    My AcadX server, and AcadUnsupp2000 both allow you to
    set Active Selection set.

    Trond Hasse Lie wrote:
    >
    > Hi.
    >
    > I was just wondering if anyone know how I can use VBA to select objects in
    > the drawing, so that the grips are enabeled/shown. The editing of the object
    > will be done manually in AutoCAD. All I want for VBA to do, is to select
    > them.
    >
    > Trond Hasse Lie
    > Norway

    --

    Checkout the AcadX(tm) ActiveX Extension Library at:

    http://www.caddzone.com/acadx/acadx.htm

    /*********************************************************/
    /* Tony Tanzillo Design Automation Consulting */
    /* Programming & Customization for AutoCAD & Compatibles */
    /* ----------------------------------------------------- */
    /* tony.tanzillo@worldnet.att.net */
    /* http://www.caddzone.com */
    /*********************************************************/
    Please use plain text.
    *Lie, Trond Hasse

    Re:

    08-15-2000 05:48 AM in reply to: *Lie, Trond Hasse
    I have downloaded the AcadX server, read the documentation, but still can't
    find out how....

    Could you give me a hint?

    Trond Hasse Lie
    Norway

    "Tony Tanzillo" wrote in message
    news:3998EC4D.FBC0D9B7@worldnet.att.net...
    > My AcadX server, and AcadUnsupp2000 both allow you to
    > set Active Selection set.
    >
    > Trond Hasse Lie wrote:
    > >
    > > Hi.
    > >
    > > I was just wondering if anyone know how I can use VBA to select objects
    in
    > > the drawing, so that the grips are enabeled/shown. The editing of the
    object
    > > will be done manually in AutoCAD. All I want for VBA to do, is to select
    > > them.
    > >
    > > Trond Hasse Lie
    > > Norway
    >
    > --
    >
    > Checkout the AcadX(tm) ActiveX Extension Library at:
    >
    > http://www.caddzone.com/acadx/acadx.htm
    >
    > /*********************************************************/
    > /* Tony Tanzillo Design Automation Consulting */
    > /* Programming & Customization for AutoCAD & Compatibles */
    > /* ----------------------------------------------------- */
    > /* tony.tanzillo@worldnet.att.net */
    > /* http://www.caddzone.com */
    > /*********************************************************/
    Please use plain text.
    *Lie, Trond Hasse

    Re:

    08-15-2000 04:25 PM in reply to: *Lie, Trond Hasse
    Now I have tried acadunsupp2000, but it doen't seem like it can do the job.
    I press a button in a form, and from the data in the form, a selectionset is
    built.
    acadunsupp2000 gave me an error when run liek a macro, but worked fine when
    I "stepped" through the code. (As it say it would in the example)

    So... How can it be done with the AcadX server?

    Trond Hasse Lie
    Norway

    "Tony Tanzillo" wrote in message
    news:3998EC4D.FBC0D9B7@worldnet.att.net...
    > My AcadX server, and AcadUnsupp2000 both allow you to
    > set Active Selection set.
    >
    > Trond Hasse Lie wrote:
    > >
    > > Hi.
    > >
    > > I was just wondering if anyone know how I can use VBA to select objects
    in
    > > the drawing, so that the grips are enabeled/shown. The editing of the
    object
    > > will be done manually in AutoCAD. All I want for VBA to do, is to select
    > > them.
    > >
    > > Trond Hasse Lie
    > > Norway
    >
    > --
    >
    > Checkout the AcadX(tm) ActiveX Extension Library at:
    >
    > http://www.caddzone.com/acadx/acadx.htm
    >
    > /*********************************************************/
    > /* Tony Tanzillo Design Automation Consulting */
    > /* Programming & Customization for AutoCAD & Compatibles */
    > /* ----------------------------------------------------- */
    > /* tony.tanzillo@worldnet.att.net */
    > /* http://www.caddzone.com */
    > /*********************************************************/
    Please use plain text.
    *Tanzillo, Tony

    Re:

    08-16-2000 12:18 AM in reply to: *Lie, Trond Hasse
    Regardless of whether you're using AcadX or AdskUnsupp2000,
    you cannot set the ActiveSelectionSet from a VBA macro that
    is executed via the VBARUN command. The reason is because
    the VBARUN command clears the active selection set when it
    terminates.

    You can only set the active selection set from a modeless
    ActiveX client (in or out of process), and only while there
    is no command active.

    Trond Hasse Lie wrote:
    >
    > Now I have tried acadunsupp2000, but it doen't seem like it can do the job.
    > I press a button in a form, and from the data in the form, a selectionset is
    > built.
    > acadunsupp2000 gave me an error when run liek a macro, but worked fine when
    > I "stepped" through the code. (As it say it would in the example)
    >
    > So... How can it be done with the AcadX server?
    >

    --

    Checkout the AcadX(tm) ActiveX Extension Library at:

    http://www.caddzone.com/acadx/acadx.htm

    /*********************************************************/
    /* Tony Tanzillo Design Automation Consulting */
    /* Programming & Customization for AutoCAD & Compatibles */
    /* ----------------------------------------------------- */
    /* tony.tanzillo@worldnet.att.net */
    /* http://www.caddzone.com */
    /*********************************************************/
    Please use plain text.
    New Member
    Posts: 1
    Registered: ‎06-05-2012

    Re: Select Object/Show grips - via Code

    12-23-2012 09:54 AM in reply to: *Lie, Trond Hasse
    Sure you can. You can find examples on http://www.abccorsicad.it/software_autocad.html You have to call SELECT command in AutoCAD from VBA and then pass handles as parameters Try this to put grips on all lines in the drawing: 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
    Please use plain text.