replace hatch with another pattern

Discussion in 'AutoCAD' started by ljb, Feb 3, 2005.

  1. ljb

    ljb Guest

    Does anyone have a VB code to replace one named hatch pattern with another.
    I'm driving AutoCAD 2000 from VB 6. I need to replace pattern SOLID with a
    closely spaced ANSI31. What I really should do is replace any pattern which
    can't be exploded with some default pattern that can be exploded. My end
    result is a DXF file without anything that resembles a BLOCK. I have an old
    legacy VAX/VMS program that cant deal with blocks importing these stripped
    down dxf files.

    thanks
    LJB
     
    ljb, Feb 3, 2005
    #1
  2. ljb

    Jürg Menzi Guest

    Hi ljb

    From Acad Help (2005), not sure for 2000:

    object.SetPattern PatternType, PatternName

    Object:
    - Hatch
    The object or objects this method applies to.

    PatternType:
    AcPatternType enum; input-only
    - acHatchPatternTypePreDefined
    Selects the pattern name from those defined in the acad.pat file.
    - acHatchPatternTypeUserDefined
    Defines a pattern of lines using the current linetype.
    - acHatchPatternTypeCustomDefined
    Selects the pattern name from a PAT file other than the acad.pat file.

    PatternName:
    String; input-only
    The name of the pattern. Sets a default hatch pattern name of up to 34
    characters, no spaces allowed. Returns "" if there is no default. Enter a period
    (.) to set no default.

    Remarks:
    The hatch pattern can be defined by one of the following options:
    PreDefined: Selects the pattern name from those defined in the acad.pat file.
    UserDefined: Defines a pattern of lines using the current linetype.
    CustomDefined: Selects the pattern name from a PAT file other than the acad.pat
    file.
    NOTE The SetPattern method should only be used for the active document.

    Cheers
     
    Jürg Menzi, Feb 3, 2005
    #2
  3. ljb

    ljb Guest

    What determines if a hatch can be exploded? Is pattern SOLID unique or are
    there other patterns that cant be exploded and I would need to replace?

    thanks
     
    ljb, Feb 3, 2005
    #3
  4. ljb

    Jürg Menzi Guest

    Hi ljb

    AFAIK, you can explode each pattern except 'SOLID'.

    Cheers
     
    Jürg Menzi, Feb 3, 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.