muck Posted March 16, 2018 Posted March 16, 2018 How can idArray passed made to be used in another method or event in the same class after the above code is ran? placing "public static ObjectId[] idArray;" in the form general area does not work Code is given below: [CommandMethod("PICKFIRST1")] public void Pickfirst1() { Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor; Database db = HostApplicationServices.WorkingDatabase; Transaction tr = db.TransactionManager.StartTransaction(); try { TypedValue[] filList = new TypedValue[1] {new TypedValue((int)DxfCode.Start, "INSERT") }; SelectionFilter filter = new SelectionFilter(filList); PromptSelectionOptions opts = new PromptSelectionOptions(); opts.MessageForAdding = "Select block references: "; PromptSelectionResult res = ed.GetSelection(opts, filter); SelectionSet selSet = res.Value; // How can idArayy be made shared in another method? ObjectId[] public static ObjectId[] idArray; = selSet.GetObjectIds(); tr.Commit(); } catch (Autodesk.AutoCAD.Runtime.Exception ex) { ed.WriteMessage(("Exception: " + ex.Message)); } finally { tr.Dispose(); } } Thank you, Quote
SLW210 Posted March 20, 2018 Posted March 20, 2018 Please read the Code Posting Guidelines and have your Code to be included in Code Tags.[NOPARSE] Your Code Here[/NOPARSE] = Your Code Here 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.