+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
  1. #1
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Apr 2011
    Posts
    90

    Smile Hatch Inherit Properties

    Registered forum members do not see this ad.

    Hi, I was just wondering if there is a button or command to set Hatch Inherit Properties? I don't want to do the whole Match Properties because that is really tideous if you are dealing with a lot of hatches. Thanks in advance

  2. #2
    Super Moderator rkmcswain's Avatar
    Computer Details
    rkmcswain's Computer Details
    Operating System:
    Windows 10
    Computer:
    HP Z240
    CPU:
    i7-7700k @ 4.20GHz
    RAM:
    64GB
    Graphics:
    Nvidia Quadro P1000
    Primary Storage:
    0.5TB SSD
    Secondary Storage:
    1TB SATA
    Monitor:
    Vizio 40"
    Discipline
    Civil
    Using
    Civil 3D 2019
    Join Date
    Sep 2005
    Location
    Houston
    Posts
    4,595

    Default

    There is an Inherit Properties button inside of the hatch dialog.
    Is that what you want?
    R.K. McSwain
    CAD Panacea | twitter

  3. #3
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Apr 2011
    Posts
    90

    Default

    Quote Originally Posted by rkmcswain View Post
    There is an Inherit Properties button inside of the hatch dialog.
    Is that what you want?
    That is what I'm trying to prevent. I kind of want to see if I can come up with a LISP and when I type "MHP" it matches the hatch properties of whatever hatch I click on. This way I don't have to be clicking on every single hatch and click Inherit Properties and then hatch.

  4. #4
    Luminous Being Dadgad's Avatar
    Using
    AutoCAD 2013
    Join Date
    Nov 2011
    Location
    At the confluence of worthlessness & invaluability
    Posts
    6,056

    Default

    Quote Originally Posted by Dj_T_Rex2002 View Post
    That is what I'm trying to prevent. I kind of want to see if I can come up with a LISP and when I type "MHP" it matches the hatch properties of whatever hatch I click on. This way I don't have to be clicking on every single hatch and click Inherit Properties and then hatch.
    If you are unaware, you can specify your favorite HATCH pattern as your default used with the HATCH command, by configuring your HPNAME system variable.

    You might want to change it somewhat frequently, depending on what you are working on. Maybe at the start of your work day, as you think about what drawings you will be working on throughout the day.

    I would suggest clicking on INHERIT PROPERTIES first, and the hatch whose properties you want to inherit, then selecting those to which it should be applied, without the need to stop or reselect inherit properties.
    Attached Images
    Last edited by Dadgad; 14th Apr 2018 at 02:02 am.
    Volume and repetition do not validate opinions forged in the absence of thought.

  5. #5
    Quantum Mechanic BIGAL's Avatar
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,709

    Default

    Try this before running hatch command pick an existing hatch.

    Code:
    (defun c:shat ( / obj )
    (while (/= chk "True")
    (if ( and (setq obj (vlax-ename->vla-object (car (entsel "pick object"))))
              (= (vla-get-objectname obj) "AcDbHatch")
        )  
    (progn 
    (setvar 'hpname (vla-get-PatternName obj))
    (setq chk "True")
    )
    (alert "You did not pick a hatch")
    )
    )
    (setq chk "false")
    )
    Last edited by BIGAL; 17th Apr 2018 at 03:31 am.
    A man who never made mistakes never made anything

  6. #6
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Apr 2011
    Posts
    90

    Default

    Quote Originally Posted by BIGAL View Post
    Try this before running hatch command pick an existing hatch.

    Code:
    (defun c:shat ( / obj )
    (while (/= chk "True")
    (if ( and (setq obj (vlax-ename->vla-object (car (entsel "pick object"))))
              (= (vla-get-objectname obj) "AcDbHatch")
        )  
    (progn 
    (setvar 'hpname (vla-get-PatternName obj))
    (setq chk "True")
    )
    (alert "You did not pick a hatch")
    )
    )
    )
    Thanks for the help BigAl, I tried the code by it did not work.

  7. #7
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Apr 2011
    Posts
    90

    Default

    Quote Originally Posted by Dadgad View Post
    If you are unaware, you can specify your favorite HATCH pattern as your default used with the HATCH command, by configuring your HPNAME system variable.

    You might want to change it somewhat frequently, depending on what you are working on. Maybe at the start of your work day, as you think about what drawings you will be working on throughout the day.

    I would suggest clicking on INHERIT PROPERTIES first, and the hatch whose properties you want to inherit, then selecting those to which it should be applied, without the need to stop or reselect inherit properties.

    The thing is that we have a lot of hatches with different annotative scales so it would be too many to keep track of. I rather just hit a command like "MH" then select the hatch and it sets it at that scale and type of hatch

  8. #8
    Quantum Mechanic BIGAL's Avatar
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,709

    Default

    Changed code to reset the chk value so runs more than once.
    A man who never made mistakes never made anything

  9. #9
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Apr 2011
    Posts
    90

    Default

    Quote Originally Posted by BIGAL View Post
    Changed code to reset the chk value so runs more than once.
    Awesome, thanks BigAl ... it works great but it doesn't match the scale. It leaves it at 1.000

  10. #10
    Quantum Mechanic BIGAL's Avatar
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,709

    Default

    Registered forum members do not see this ad.

    Time for you to have a go look at code above and work out where these fit Hpscale & Patternscale

    Code:
    ; Property values:
    ;   Application (RO) = #<VLA-OBJECT IAcadApplication 0000000140063f10>
    ;   Area (RO) = 15363.3
    ;   AssociativeHatch = 0
    ;   BackgroundColor = #<VLA-OBJECT IAcadAcCmColor 00000000461cfb70>
    ;   Document (RO) = #<VLA-OBJECT IAcadDocument 000000002a5d4ee8>
    ;   Elevation = 0.0
    ;   EntityTransparency = "ByLayer"
    ;   GradientAngle = 0.0
    ;   GradientCentered = -1
    ;   GradientColor1 = #<VLA-OBJECT IAcadAcCmColor 00000000461d0230>
    ;   GradientColor2 = #<VLA-OBJECT IAcadAcCmColor 00000000461d2750>
    ;   GradientName = "LINEAR"
    ;   Handle (RO) = "12B52"
    ;   HasExtensionDictionary (RO) = 0
    ;   HatchObjectType = 0
    ;   HatchStyle = 1
    ;   Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 00000000461d1fd8>
    ;   ISOPenWidth = 100
    ;   Layer = "DEFAULT"
    ;   Linetype = "ByLayer"
    ;   LinetypeScale = 1.0
    ;   Lineweight = -1
    ;   Material = "ByLayer"
    ;   Normal = (0.0 0.0 1.0)
    ;   NumberOfLoops (RO) = 1
    ;   ObjectID (RO) = 42
    ;   ObjectName (RO) = "AcDbHatch"
    ;   Origin = (0.0 0.0)
    ;   OwnerID (RO) = 43
    ;   PatternAngle = 0.0
    ;   PatternDouble = 0
    ;   PatternName (RO) = "ANSI31"
    ;   PatternScale = 1.0
    ;   PatternSpace = 1.0
    ;   PatternType (RO) = 1
    ;   PlotStyleName = "ByLayer"
    ;   TrueColor = #<VLA-OBJECT IAcadAcCmColor 00000000461d3050>
    ;   Visible = -1
    A man who never made mistakes never made anything

Similar Threads

  1. Hatch cannot match properties
    By wimal in forum AutoCAD General
    Replies: 2
    Last Post: 9th Sep 2017, 10:21 am
  2. prevents the master drawing inherit styles of xrefs?
    By samifox in forum AutoCAD Drawing Management & Output
    Replies: 4
    Last Post: 15th Mar 2017, 12:42 pm
  3. Preset HATCH properties?
    By Daniel C in forum AutoCAD Beginners' Area
    Replies: 1
    Last Post: 4th Oct 2012, 04:28 pm
  4. inherit property
    By Dipali in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 4
    Last Post: 4th Dec 2008, 09:19 pm
  5. Insert block & inherit layer from snap point?
    By martymoose in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 18th Nov 2008, 06:30 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts