.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Trim hatching

5 REPLIES 5
Reply
Message 1 of 6
stardust1611
1399 Views, 5 Replies

Trim hatching

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

Tags (1)
5 REPLIES 5
Message 2 of 6

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...

Message 3 of 6

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?

Message 4 of 6
stardust1611
in reply to: stardust1611

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]

 

Message 5 of 6
stardust1611
in reply to: stardust1611

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.

Message 6 of 6


@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

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost