Trim hatching

Trim hatching

stardust1611
Enthusiast Enthusiast
2,143 Views
5 Replies
Message 1 of 6

Trim hatching

stardust1611
Enthusiast
Enthusiast

Hi. How to trim hatching inside a polyline, but that the part that is outside the polyline still stays?

0 Likes
2,144 Views
5 Replies
Replies (5)
Message 2 of 6

Ajilal.Vijayan
Advisor
Advisor

You need to edit the hatch boundary to include the polyline.

So that this polyline will be added to the hatch boundary objects, hence the polyline will work as an inner loop to the hatch.

 

Check this tutorial.

http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer%27s%20Guide/index.html?url=WS1a9193...

0 Likes
Message 3 of 6

stardust1611
Enthusiast
Enthusiast

Thank you Ajilal for the reply. But, I have a more complex situation where there are multiple different hatchings intersecting the polyline in parallel, and i need to trim all of them. Each hatching covers only a portion of the rectangular polyline. Is there some other method except for editing hatch boundary?

0 Likes
Message 4 of 6

stardust1611
Enthusiast
Enthusiast

If someone could give me an example of how to trim hatching with aced_cmd, then that would be very nice. Or maybe with ads_queueexpr. I tried, but don't know how to exactly compose the command. When I try this, I get an error "Cannot TRIM this object":

 

 

[Code]

 

ads_queueexpr(uEncode.GetBytes("(Command \"_.trim\"" +
                                                            "(handent \"" + pline.Handle + "\")" +
                                                            "\"" + "\"" +
                                                            "(handent \"" + ent.Handle + "\")" +
                                                            "\"" + "\"" + "\"" + "\"" +
                                                                               ")"));

 

 

[/Code]

 

0 Likes
Message 5 of 6

stardust1611
Enthusiast
Enthusiast

This could be also done by executing the EXTRIM command from the Express Tools, but I don't know how to call it because it's an AutoLisp command. The command requires a polyline to be selected, and a point inside or outside the polyline, so I would need to pass it an object handle and a point.

0 Likes
Message 6 of 6

Ajilal.Vijayan
Advisor
Advisor

@stardust1611 wrote:

, but I don't know how to call it because it's an AutoLisp command.


As you mentioned Autolisp , please try this LISP.

 

'Using hatchedit
(defun c:test (/ hat pol)
(setq hat (entsel "\nSelect Hatch:"))
(setq pol (entsel "\nSelect Polyline:"))
(command "-hatchedit" hat "ad" "s" pol "" "")
);defun

'Using TRIM command
(defun c:test1 (/ hat pol)
(setq hat (entsel "\nSelect Hatch:"))
(setq pol (entsel "\nSelect Polyline:"))
(command "trim" pol "" hat "")
);defun

 

0 Likes