Selecting lines with linetype of Hidden.

Discussion in 'AutoCAD' started by David M. Gardner, Sep 22, 2004.

  1. What I'm looking to do is to change the color of all hidden lines in my drawing. I just don't know how to select the lines with a type of hidden.


    On Error Resume Next
    Set ss = ThisDrawing.SelectionSets("temp")
    If Err Then Set ss = ThisDrawing.SelectionSets.Add("temp")
    ss.Clear
    On Error GoTo 0

    fType(0) = 0: fData(0) = "INSERT"
    fType(1) = 2: fData(1) = BlkName
    ss.Select acSelectionSetAll, , , fType, fData

    I use the above code to select a block by a name. Can this be modified to select all lines with a linetype of "Hidden"? Someone gave me this code and I don't understand how it works.

    --

    Thanks,

    David M. Gardner
    Change the DOT to reply.
     
    David M. Gardner, Sep 22, 2004
    #1
  2. David M. Gardner

    bcoward Guest

    David,

    You should be able to get all hidden linetypes with the following.

    Sub SelHiddenLType()

    Dim SS As AcadSelectionSet
    Dim fType(1) As Integer
    Dim fData(1) As Variant

    Set SS = SSDel("temp")

    fType(0) = 0: fData(0) = "line"
    fType(1) = 6: fData(1) = "HIDDEN"

    SS.Select acSelectionSetAll, , , fType, fData

    MsgBox SS.Count & " hidden line(s) found"


    End Sub

    Private Function SSDel(strName As String) As AcadSelectionSet

    ' Check Selection Set Name

    Dim ObjSS As AcadSelectionSet
    Dim objSSets As AcadSelectionSets

    Set objSSets = ThisDrawing.SelectionSets
    For Each ObjSS In objSSets
    If ObjSS.Name = strName Then
    objSSets.Item(strName).Delete
    Exit For
    End If
    Next
    Set ObjSS = objSSets.Add(strName)
    Set SSDel = ObjSS

    End Function


    Good luck,

    Bob Coward
    CADS, Inc


    800-366-0946
     
    bcoward, Sep 22, 2004
    #2
  3. Can you please explain the "ftype" and "fdata".

    --

    Thanks,

    David M. Gardner
    Change the DOT to reply.
     
    David M. Gardner, Sep 22, 2004
    #3
  4. David M. Gardner

    Tim Riley Guest

    From AutoCAD developer's help:

    ftype = FilterType "Integer; input-only; optional A DXF group code
    specifying the type of filter to use."

    fdata = FilterData "Variant; input-only; optional The value to filter on."

    ~Tim Riley
     
    Tim Riley, Sep 22, 2004
    #4
  5. David M. Gardner

    Raul Coelho Guest

    Hi Bob Coward,

    Is there a table were we can see all the fType and fData integer
    correspondense?

    Thanks
     
    Raul Coelho, Sep 23, 2004
    #5
  6. David M. Gardner

    bcoward Guest

    Raul,

    This isn't a hey Bob question but flattery for the day will get an answer...lol

    I believe your asking for and explanation that comes from the AutoCAD DXF Reference Help files. These are simply the associated dotted pair equals you might remember from the Lispr dayz. Some are easy to find, such as 0, and 8, while others are deep in the pages. This is where I find the answer to what to use (fType) and what it matches (fData).

    I hope this helps.

    Regards,

    Bob Coward
    CADS, Inc

    800-366-0946
     
    bcoward, Sep 23, 2004
    #6
  7. Could this be what you are looking for? I went to the "Developers Help" in
    AutoCAD and indexed to "DXF" then chose "DXF, conventions, group codes in
    numerical order" This seems to match.

    --

    Thanks,

    David M. Gardner
    Change the DOT to reply.
     
    David M. Gardner, Sep 23, 2004
    #7
  8. What is the ftype and fdata for a polyline?

    --

    Thanks,

    David M. Gardner
    Change the DOT to reply.
     
    David M. Gardner, Sep 23, 2004
    #8
  9. Or is there a way to select any entity that has a hidden linetype? ie.
    circles, arcs, etc.

    --

    Thanks,

    David M. Gardner
    Change the DOT to reply.
     
    David M. Gardner, Sep 23, 2004
    #9
  10. David M. Gardner

    bcoward Guest

    David,

    To select any common entity with hidden linetypes I took the original posted code and just asked for hidden linetypes.

    fType(0) = 6: fData(0) = "HIDDEN"
    SS.Select acSelectionSetAll, , , fType, fData

    You might want to play around with the posted code a lttle and see what entities you get with each run of the code.

    If you add :

    SS.Highlight True

    You'll be able to see the selection set entities highlighted.

    Good luck,

    Bob Coward
    CADS, Inc

    800-366-0946
     
    bcoward, Sep 23, 2004
    #10
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.