.NET

Reply
Active Contributor
stardust1611
Posts: 40
Registered: ‎11-29-2008
Message 1 of 6 (185 Views)

Trim hatching

185 Views, 5 Replies
03-25-2014 02:41 AM

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

Valued Mentor
Ajilal.Vijayan
Posts: 425
Registered: ‎01-12-2008
Message 2 of 6 (168 Views)

Re: Trim hatching

03-25-2014 04:48 AM in reply to: stardust1611

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

Active Contributor
stardust1611
Posts: 40
Registered: ‎11-29-2008
Message 3 of 6 (149 Views)

Re: Trim hatching

03-25-2014 08:28 AM in reply to: Ajilal.Vijayan

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?

Active Contributor
stardust1611
Posts: 40
Registered: ‎11-29-2008
Message 4 of 6 (121 Views)

Re: Trim hatching

03-27-2014 01:28 PM 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]

 

Active Contributor
stardust1611
Posts: 40
Registered: ‎11-29-2008
Message 5 of 6 (97 Views)

Re: Trim hatching

04-02-2014 11:53 PM 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.

Valued Mentor
Ajilal.Vijayan
Posts: 425
Registered: ‎01-12-2008
Message 6 of 6 (91 Views)

Re: Trim hatching

04-03-2014 01:09 AM in reply to: stardust1611

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

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community