Is there any way to prevent the HPCOLOR variable from being changed?
Try this:
Please tell me there is a way to lock this setting.
I always want it to "Use Current".
Changing the current color should not trigger a change to the hatch setting.
Mark Green
Working on Civil 3D in Canada
Solved! Go to Solution.
Solved by cadffm. Go to Solution.
Solved by ВeekeeCZ. Go to Solution.
What version of AutoCAD are you running? Do a screenshot of About command and share that here
Hi,
it changes by point 3)
No need to set cecolor to anopther value,
just
HPCOLOR to use the current color
Create a hatch
check HPCOLOR value
tested in some versions in 2021.1.3-2025.1
Sebastian
Reading OP seems to suggest that even with HPcolor use current every time after a color change the previous color is used and not the new color until after a hatch is completed
@paullimapa wrote:
even with HPcolor use current every time after a color change
No,
if you set hplayer to "use current" and you created a hatch,
hpcolor changed from "use current" to "red" (if color1 was the current color while hatching)
You can set cecolor to whatever xolor, since hpcolor is set to 1 (for example), it will create hatchs with color red.
Sebastian
It doesn't do that for me [Acad2024 here].
But if a workaround is needed, it seems to me it would involve no more steps to just change the color of the Hatch after making it, rather than changing the current-color setting before making it. CHPROP, or CHANGE's Properties option, or without any command in the Properties palette.
EDITED
Hi,
in 2024.1.2 it does
HPCOLOR 'use current' and set cecolor to whatever you want, bylayer for example or color3, whatever.
create a hatch
check HPCOLOR
If it is still on "use current", it acts really differently on your side.
Sebastian
I'm experiencing what @troma is experiencing on my 2024.1.5 & 2025.1
When I set hpcolor to . or "use current" and my cecolor is yellow and then I run the Hatch command my pattern will be yellow. But once I run cecolor command again and change it this time to red the hpcolor setting still shows the previous color 2 which is yellow. It's not switching to the current cecolor. I would have to run hpcolor command again and enter . or "use current" again and then the next hatch generated will use now the cecolor of red.
Mark Green
Working on Civil 3D in Canada
@troma wrote:...Please tell me there is a way to lock this setting....
Yes: you need to customize and exclusive use LISP for those tasks, and never just a ore command, if you need total control 100% of the time all the time regardless of AutoCAD version or variant quirks.
Whether the LISP changes the hatch color before or after creation does not matter, the LISP should ask and then do what you want.
There is a dedicated LISP forum if you need help coding it.
If you want Autodesk for "fix it", your C3D2019 is out. And they only listen to paying subscribers for wishlists and bug fixes now
https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/Feedback-to-Autode...
Best wishes.
Hi Paul
as I wrote
"the hpcolor setting still shows the previous color 2 which is yellow. It's not switching to the current cecolor. "
Color1 - 255, bylayer or byblock, all values are wrong!
The problem is that Acad doesn't keep the HPCOLOR by the setting you choosed, if it was "." / use current.
it works for all other values, but not for 'use current'.
Write to Adesk and ask for a fix, the bug is sure known and exist since version 2016
Sebastian
I'm with OP here. It would be nice to have kept as you say before the 2016 version of how AutoCAD handled the HPCOLOR setting instead of now having to run that setting again every time you change the CECOLOR. Why change two settings when it would have been so easy to just change one. Could you imagine if HPCOLOR was set to BYLAYER and then it won't work when your LAYER is set to another and you'll have to run HPCOLOR again and input BYLAYER again?
But I do have to say that I rarely (though I wouldn't say never) change the cecolor from bylayer. I rather rely on the layer color property to determine an object's color than have different objects assigned with their own colors.
Mark Green
Working on Civil 3D in Canada
@Kent1Cooper wrote:It doesn't do that for me [Acad2024 here].
But if a workaround is needed, it seems to me it would involve no more steps to just change the color of the Hatch after making it, rather than changing the current-color setting before making it. CHPROP, or CHANGE's Properties option, or without any command in the Properties palette.
You're right, it would be easy to change afterwards (apart from the sometimes challenging step of selecting a hatch object). The problem lies in the unexpected behaviour. So I end up doing everything twice (both before and afterwards) because the machine didn't do what I thought it would do.
I would also be interested to know if this has been fixed for 2024. I don't have the opportunity to test it.
Mark Green
Working on Civil 3D in Canada
"I would also be interested to know if this has been fixed for 2024. I don't have the opportunity to test it."
It's not (see pauls and my answer, we tested up to 2025
and at last BeeKeeCZ answer, he found an important fact)
Sebastian
Can't find what you're looking for? Ask the community or share your knowledge.