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

Hatching for an object

8 REPLIES 8
Reply
Message 1 of 9
Anonymous
535 Views, 8 Replies

Hatching for an object

Hai,

Can any one tell how to use hatching for an object for example a circle

Regards,
N. siva shanmugam.
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: Anonymous

Hai,

To be more precise how fill a color for a circle using hatching.

Regards,
N. siva shanmugam.
Message 3 of 9
Anonymous
in reply to: Anonymous

Hai,
Plz provide an example of how to fill a color a circle using hatching.

Regards,
N. Siva shanmugam.
Message 4 of 9
Anonymous
in reply to: Anonymous

http://dictionary.reference.com/search?r=2&q=self-importance

--
gl - Paul
wrote in message news:5126441@discussion.autodesk.com...
Hai,
Plz provide an example of how to fill a color a circle using hatching.

Regards,
N. Siva shanmugam.
Message 5 of 9
Anonymous
in reply to: Anonymous

It is something like this, this should help for the start.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BlockTableRecord btr = (BlockTableRecord)myT.GetObject(db.CurrentSpaceId,
OpenMode.ForWrite, false);



Circle MeasuringPoint = new Circle(InsertPoint, new Vector3d(0, 0, 1),
Radius);

btr.AppendEntity(MeasuringPoint);

myT.AddNewlyCreatedDBObject(MeasuringPoint, true);

ObjectIdCollection IDColl = new ObjectIdCollection();

IDColl.Add(MeasuringPoint.ObjectId);


Hatch MeasuringHatch = new Hatch();

MeasuringHatch.SetHatchPattern(HatchPatternType.PreDefined, "SOLID");

btr.AppendEntity(MeasuringHatch);

myT.AddNewlyCreatedDBObject(MeasuringHatch, true);

MeasuringHatch.Associative = true;

MeasuringHatch.AppendLoop(1, IDColl);

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


--
Roland Feletic
schrieb im Newsbeitrag
news:5126398@discussion.autodesk.com...
Hai,

Can any one tell how to use hatching for an object for example a circle

Regards,
N. siva shanmugam.
Message 6 of 9
Anonymous
in reply to: Anonymous

Hai,

thanks roland its working fine.

But the hatch and circle is taken as a seperate entity when I move with the help of the mouse, but I need both hatch and circle to act as a same entity.

It mean after creating my program when I move the circle with the help of the mouse the hatch should also be moved simultaneously,

Regards,
N. Siva shanmugam.
Message 7 of 9
Anonymous
in reply to: Anonymous

The hatch should be associative. If you move the circle the hatch should
stay in the circle. For me it works.

--
Roland Feletic
Message 8 of 9
Anonymous
in reply to: Anonymous

Hai

Thanks for the reply and support...

But when I try your code both the hatch and the circle is taking as a seperate entity. I don't where I am going wrong.

Plz check the below code which is what i tried.

Code:
----------
AcadDb.Circle circleobj = new AcadDb.Circle(new Autodesk.AutoCAD.Geometry.Point3d(30, 10, 0),Autodesk.AutoCAD.Geometry.Vector3d.ZAxis, 5);

AcadDb.Database db = AcadApp.DocumentManager.MdiActiveDocument.Database;

Autodesk.AutoCAD.DatabaseServices.Transaction tm = db.TransactionManager.StartTransaction();

Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;

try
{
AcadDb.BlockTable bt = (AcadDb.BlockTable)tm.GetObject(db.BlockTableId,AcadDb.OpenMode.ForRead);
AcadDb.BlockTableRecord btr = (AcadDb.BlockTableRecord)tm.GetObject(AcadDb.HostApplicationServices.WorkingDatabase.CurrentSpaceId,AcadDb.OpenMode.ForWrite);

btr.AppendEntity(circleobj);
tm.AddNewlyCreatedDBObject(circleobj,true);

AcadDb.Hatch hatch = new Autodesk.AutoCAD.DatabaseServices.Hatch();

AcadDb.ObjectIdCollection objcol = new Autodesk.AutoCAD.DatabaseServices.ObjectIdCollection ();
objcol.Add(circleobj.ObjectId);
hatch.SetHatchPattern(AcadDb.HatchPatternType.PreDefined, "SOLID");

hatch.ColorIndex = 4;

btr.AppendEntity(hatch);

tm.AddNewlyCreatedDBObject(hatch,true);

hatch.Associative = true;

hatch.AppendLoop(1,objcol);

tm.Commit();





}
catch(Exception ex)
{
throw ex;
}
finally
{
tm.Dispose();
}



Thank you,

Regards,
N. siva shanmugam.
Message 9 of 9
Anonymous
in reply to: Anonymous

Hi

Can anyone expand on this and demonstrate the more complex case of a polygon (or more) within a polygon, where the inner ones are not filled

Tks

Thiss

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

Post to forums  

Forma Design Contest


Autodesk Design & Make Report