k22 Posted December 2, 2013 Posted December 2, 2013 Morning All, I need help to create a new point style so i can use it as a single point or multipoint for when i bring in x-y coordinates. Or if i create a block how can i use it as a multipoint for x-y coordinates? Thanks Quote
ReMark Posted December 2, 2013 Posted December 2, 2013 Check your AutoCAD Help file. The topic will be Create Point Objects (.NET). Quote
k22 Posted December 2, 2013 Author Posted December 2, 2013 Thanks Mark, Ive come across this using Autodesk.AutoCAD.Runtime;using Autodesk.AutoCAD.ApplicationServices;using Autodesk.AutoCAD.DatabaseServices;using Autodesk.AutoCAD.Geometry; [CommandMethod("AddPointAndSetPointStyle")]public static void AddPointAndSetPointStyle(){ // Get the current document and database Document acDoc = Application.DocumentManager.MdiActiveDocument; Database acCurDb = acDoc.Database; // Start a transaction using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction()) { // Open the Block table for read BlockTable acBlkTbl; acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) as BlockTable; // Open the Block table record Model space for write BlockTableRecord acBlkTblRec; acBlkTblRec = acTrans.GetObject(acBlkTbl[blockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord; // Create a point at (4, 3, 0) in Model space DBPoint acPoint = new DBPoint(new Point3d(4, 3, 0)); acPoint.SetDatabaseDefaults(); // Add the new object to the block table record and the transaction acBlkTblRec.AppendEntity(acPoint); acTrans.AddNewlyCreatedDBObject(acPoint, true); // Set the style for all point objects in the drawing acCurDb.Pdmode = 34; acCurDb.Pdsize = 1; // Save the new object to the database acTrans.Commit(); }} need abit of help on this Quote
k22 Posted December 2, 2013 Author Posted December 2, 2013 Also could i use a block I've already created as a multipoint for when i bring in x-y coordinates from excel? Quote
ReMark Posted December 2, 2013 Posted December 2, 2013 Mentioning that you read the referenced material would have sufficed. Just what is a multipoint block? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.