I have many hatches in tool palettes. The original way to create hatches in tool palettes is not working well. We are getting many errors and also don't like the process of hatching from a tool palette.
To get around hatching from the tool palette while still using the tool palette, I wrote a script that uses -hatch and changes all the settings for each hatch. See example below. The only problem I can't figure out is that I need to set the plotstyle for the individual hatch being used. The layer uses "black" plotstyle, but some of the hatches need to be "black 60%" or "black 80%" plotstyles. Is there a way to specify the specific hatch plotstyle in the script? And if not, is it possible to do all of this is LISP instead? Any info would be greatly appreciated.
Example Script:
-layer
new
C-SITE-PVMT-PATT
color
7
C-SITE-PVMT-PATT
-hatch
p
cross
.5
0
la
C-SITE-PVMT-PATT
co
195
none
Solved! Go to Solution.
Solved by ВeekeeCZ. Go to Solution.
Have you looked at image menu's fully controllable, these are pop menu's or could use a toolbar with say flyouts, the default image menu has 16 images, you can make your own custom dcl like a 3x3, 2x2 etc
I did think about. Not sure exactly where to start though. I figured script or lisp would be much easier to create and load. I used a script above, and also wrote a lisp this morning that is probably not very good, but it works. Again, all I need to be able to do is set the plotstyle of the new hatch to "Black 60%" while keeping the plotstyle of the layer C-SITE-PVMT-PATT "Black". I'm close, but I just can't get it.
(defun c:hdcp (/ la)
(setq la (getvar "clayer"))
(if (tblsearch "layer" "C-SITE-PVMT-PATT")
(setvar "clayer" "C-SITE-PVMT-PATT")
(command
"_. LAYER"
"T" "C-SITE-PVMT-PATT"
"M" "C-SITE-PVMT-PATT"
"C" "7" ""
"LT" "Continuous" ""
"D" "Project Site: Pavement hatching" "*" "_yes"
"PS" "Black" "C-SITE-PVMT-PATT"
""
); end command function
);end if
(command "-hatch" "Properties" "cross" ".5" "0" "co" "195" "none" pause "")
(setvar "clayer" la)
(princ)
)
The line like this just after your -hatch line won't help?
(command "_.chprop" "_last" "" "_plotstyle" "Black 60%" "")
Or it's the 'cplotstyle sysvar if you want to set it prior to the command in the same manner as the 'clayer.
@Nathan_Tigner wrote:
I did think about. Not sure exactly where to start though. I figured script or lisp would be much easier to create and load. I used a script above, and also wrote a lisp this morning that is probably not very good, but it works. Again, all I need to be able to do is set the plotstyle of the new hatch to "Black 60%" while keeping the plotstyle of the layer C-SITE-PVMT-PATT "Black". I'm close, but I just can't get it.
(defun c:hdcp (/ la)
(setq la (getvar "clayer"))(if (tblsearch "layer" "C-SITE-PVMT-PATT"); the layer exist, what happen if is frozen?(setvar "clayer" "C-SITE-PVMT-PATT") ;
(command"_. LAYER"
"T" "C-SITE-PVMT-PATT" ; the layer does not exist so why you do thaw it?
"M" "C-SITE-PVMT-PATT"
"C" "7" ""
"LT" "Continuous" ""
"D" "Project Site: Pavement hatching" "*" "_yes"
"PS" "Black" "C-SITE-PVMT-PATT"
""
); end command function
);end if
(command "-hatch" "Properties" "cross" ".5" "0" "co" "195" "none" pause "")(setvar "clayer" la)
(princ)
)
Think of the code you wrote...
Better remove the crossed out.
Can't find what you're looking for? Ask the community or share your knowledge.