.NET

Reply
Active Contributor
DouceDeux
Posts: 46
Registered: ‎09-04-2012
Message 1 of 2 (240 Views)

Block Reference Hatch - Deleting loops within a Hatch

240 Views, 1 Replies
02-22-2013 02:51 PM

Hello all!

 

I want to be able to add a Block Reference to a hatch.

I'm adding the block reference to an ObjectIdCollection and the hatch is not taking it when using AddLoop().

So I thought maybe I needed to add the location of the polyline (curve-like) object that is member of the blockreference to the hatch, but I don't know how to get its ObjectId.

 

Hatch thisHatch = new Hatch();
thisHatch.Layer = layerName;
thisHatch.SetDatabaseDefaults();
thisHatch.SetHatchPattern(patternType, patterName);
thisHatch.Color = Color.FromColorIndex(ColorMethod.ByColor, colorIndex);
thisHatch.Transparency = new Transparency((Byte)(255 * (100 - 60) / 100));

tSpace.AppendEntity(thisHatch);
transaction.AddNewlyCreatedDBObject(thisHatch, true);

thisHatch.Associative = true;
                
ObjectIdCollection newOIC1 = new ObjectIdCollection();
newOIC1.Add(hatchElement);
thisHatch.AppendLoop(HatchLoopTypes.Default, newOIC1);
ObjectIdCollection newOIC2 = new ObjectIdCollection();
newOIC2.Add(laLosa);
thisHatch.AppendLoop(HatchLoopTypes.External, newOIC2);
thisHatch.EvaluateHatch(true);
                
ObjectIdCollection newOIC3 = new ObjectIdCollection();
newOIC3.Add(thisHatch.ObjectId);
newDOT.MoveToBottom(newOIC3);

 

 

Also, I'm trying to delete certain HatchLoop that is associated to a polyline but I don't know how to do it. I'm going through the loops in the hatch but I don't know what to do there. I wanna do this so I create a new and different hatch on top.

I think one could also copy all the loops except the one one wants to delete, but I'm not sure how to tell which one is the one I want to delete that is the one associated to a polyline or that is in certain region.

 

Thanks in advance.

 

 

Moderator
Alexander.Rivilis
Posts: 1,398
Registered: ‎04-09-2008
Message 2 of 2 (196 Views)

Re: Block Reference Hatch - Deleting loops within a Hatch

02-25-2013 06:42 AM in reply to: DouceDeux

You can clone polyline, transform it with BlockReference.BlockTransform matrix and use this clone as a hatch loop.


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

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