Dj_T_Rex2002 Posted April 12, 2018 Share Posted April 12, 2018 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 Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted April 12, 2018 Share Posted April 12, 2018 There is an Inherit Properties button inside of the hatch dialog. Is that what you want? Quote Link to comment Share on other sites More sharing options...
Dj_T_Rex2002 Posted April 12, 2018 Author Share Posted April 12, 2018 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. Quote Link to comment Share on other sites More sharing options...
Dadgad Posted April 13, 2018 Share Posted April 13, 2018 (edited) 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. Edited April 14, 2018 by Dadgad Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 13, 2018 Share Posted April 13, 2018 (edited) Try this before running hatch command pick an existing hatch. (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") ) Edited April 17, 2018 by BIGAL Quote Link to comment Share on other sites More sharing options...
Dj_T_Rex2002 Posted April 16, 2018 Author Share Posted April 16, 2018 Try this before running hatch command pick an existing hatch. (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. Quote Link to comment Share on other sites More sharing options...
Dj_T_Rex2002 Posted April 16, 2018 Author Share Posted April 16, 2018 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 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 17, 2018 Share Posted April 17, 2018 Changed code to reset the chk value so runs more than once. Quote Link to comment Share on other sites More sharing options...
Dj_T_Rex2002 Posted April 17, 2018 Author Share Posted April 17, 2018 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 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 18, 2018 Share Posted April 18, 2018 Time for you to have a go look at code above and work out where these fit Hpscale & Patternscale ; 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 Quote Link to comment Share on other sites More sharing options...
Dj_T_Rex2002 Posted April 18, 2018 Author Share Posted April 18, 2018 Time for you to have a go look at code above and work out where these fit Hpscale & Patternscale ; 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 Yeah I have no clue where they would fit in it haha my lisp knowledge is too basic. I just know how to do little things. I'm still trying to learn the whole coding thing. I will try to work with what you gave me thank you Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 19, 2018 Share Posted April 19, 2018 Here is a hint (setvar 'hpname (vla-get-PatternName obj)) have a look at the two words I posted add the line and change. If your looking for something else as well then look at the dump to find its name which can be different to its variable name. hpname=Pattername. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.