Each line

Discussion in 'AutoCAD' started by giggio, Mar 11, 2005.

  1. giggio

    giggio Guest

    Hi everyone,
    it's my problem:
    My vba Macro must find all line on my drawing...
    It's possible?
    Sorry but I'm very inexpert..
     
    giggio, Mar 11, 2005
    #1
  2. giggio

    Joe Sutphin Guest

    Here ya go ...

    Joe
    --

    'DXF Group Code Constants
    Public Const ENTITY = 0 'an entity

    Public Function CreateSelectionSet(SelectionSet As AcadSelectionSet, _
    FilterCode As Integer, _
    FilterValue As String) As Boolean
    Dim iFilterCode(0) As Integer
    Dim vFilterValue(0) As Variant

    iFilterCode(0) = FilterCode
    vFilterValue(0) = FilterValue

    'SelectionSet.Select acSelectionSetAll, , , iFilterCode, vFilterValue
    SelectionSet.SelectOnScreen iFilterCode, vFilterValue

    If SelectionSet.Count Then
    CreateSelectionSet = True
    End If
    End Function

    Public Sub GetLines()
    Dim objSS As AcadSelectionSet
    Dim intFilterCode(0) As Integer
    Dim strFilterValue(0) As String

    On Error Resume Next
    ThisDrawing.SelectionSets("Lines").Delete

    Set objSS = ThisDrawing.SelectionSets.Add("Lines")

    CreateSelectionSet objSS, ENTITY, "LINE"

    MsgBox "Number of entities selected: " & objSS.Count
    End Sub
     
    Joe Sutphin, Mar 11, 2005
    #2
  3. Hi,

    Yes.

    If you look in the VBA help files under Selection Sets, you should find
    everything you need.

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au
     
    Laurie Comerford, Mar 11, 2005
    #3
  4. giggio

    giggio Guest

    Thanks you
     
    giggio, Mar 11, 2005
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.