Extrude in vertical direction using C#
in Other
Hello everybody,
just a quick question regarding using Extrude command from .NET environment. I would like to extrude a region in vertical direction similar to Bricscad command Extrude/Direction.
I did:
just a quick question regarding using Extrude command from .NET environment. I would like to extrude a region in vertical direction similar to Bricscad command Extrude/Direction.
I did:
Region regi = (Region)acTrans.GetObject(ids[i], OpenMode.ForRead); Solid3d pSolid = new Solid3d(); pSolid.RecordHistory = true; pSolid.Extrude(regi, 1000, 0);
This extrudes my region perpendicular to the plane of region. I would like this to be in vertical z axis.
Not sure what the most efficient way is.
Please advise
many thanks
Jiri
0
Comments
-
try defining the extrusion direction you wish by picking 2 points....
Vector3d dVector = new Vector3d();
Double eXheight = 0.0;
// Select the wished extrusion direction
Point3d p1 = ed.GetPoint("Start point of extrusion direction :").Value;
Point3d p2 = ed.GetPoint("End point of extrusion direction :").Value;
// the direction vector
dVector = new Vector3d(p2.X - p1.X, p2.Y - p1.Y, p2.Z - p1.Z);
// ......selection set in editor
SelectionSet ss = pSelres.Value;
ObjectId[] idarray = ss.GetObjectIds();
Entity[] lps = new Entity[ss.Count];
Entity regEnt = trans.GetObject(idarray[0], OpenMode.ForRead) as Entity;
//// create the extruded solid using your selected region ...
Solid3d sol = new Solid3d();
sol.CreateExtrudedSolid(regEnt, dVector, new SweepOptionsBuilder());
// ... and add it to the modelspace
ms.AppendEntity(sol);
trans.AddNewlyCreatedDBObject(sol, true);
hope this helps !
Regards0 -
Hi Konstantine
many thanks. You put me on the right track.
Making progress now.
Best regards
jiri0
This discussion has been closed.