青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

C++ Programmer's Cookbook

{C++ 基礎} {C++ 高級} {C#界面,C++核心算法} {設計模式} {C#基礎}

ManagedARX與用戶交互(讓用戶選擇各種....)&&各種選擇集合方法使用

讓用戶選取點,線,實體,角度,距離,............................................

//?Copyright?2004-2006?by?Autodesk,?Inc.
//
//Permission?to?use,?copy,?modify,?and?distribute?this?software?in
//object?code?form?for?any?purpose?and?without?fee?is?hereby?granted,?
//provided?that?the?above?copyright?notice?appears?in?all?copies?and?
//that?both?that?copyright?notice?and?the?limited?warranty?and
//restricted?rights?notice?below?appear?in?all?supporting?
//documentation.
//
//AUTODESK?PROVIDES?THIS?PROGRAM?"AS?IS"?AND?WITH?ALL?FAULTS.?
//AUTODESK?SPECIFICALLY?DISCLAIMS?ANY?IMPLIED?WARRANTY?OF
//MERCHANTABILITY?OR?FITNESS?FOR?A?PARTICULAR?USE.??AUTODESK,?INC.?
//DOES?NOT?WARRANT?THAT?THE?OPERATION?OF?THE?PROGRAM?WILL?BE
//UNINTERRUPTED?OR?ERROR?FREE.
//
//Use,?duplication,?or?disclosure?by?the?U.S.?Government?is?subject?to?
//restrictions?set?forth?in?FAR?52.227-19?(Commercial?Computer
//Software?-?Restricted?Rights)?and?DFAR?252.227-7013(c)(1)(ii)
//(Rights?in?Technical?Data?and?Computer?Software),?as?applicable.

using?System;
using?Autodesk.AutoCAD.DatabaseServices;
using?Autodesk.AutoCAD.Runtime;
using?Autodesk.AutoCAD.Geometry;
using?Autodesk.AutoCAD.ApplicationServices;
using?Autodesk.AutoCAD.EditorInput;

namespace?Prompts
{
????
public?class?PromptsTest
????
{
????????
static?PromptAngleOptions?useThisAngleOption;
????????
static?PromptDoubleResult?useThisAngleResult;
????????
static?PromptPointOptions?useThisPointOption;
????????
static?PromptPointResult?useThisPointResult;
????????
static?PromptEntityOptions?useThisEntityOption;
????????
static?PromptEntityResult?useThisEntityResult;

????????
//A?small?function?that?shows?how?to?prompt?for?an?integer
????????[CommandMethod("GetInteger")]?
????????
public?void?integerTest()
????????
{
????????????Editor?ed?
=?Application.DocumentManager.MdiActiveDocument.Editor;
????????????PromptIntegerOptions?opt0?
=?new?PromptIntegerOptions("Enter?your?age");
????????????opt0.AllowNegative?
=?false;
????????????opt0.AllowNone?
=?false;
????????????opt0.AllowZero?
=?false;
????????????opt0.DefaultValue?
=?1;
????????????PromptIntegerResult?IntRes?
=?ed.GetInteger(opt0);
????????????
if(IntRes.Status?==?PromptStatus.OK)
????????????
{
????????????????ed.WriteMessage(
string.Format("\nYou?entered?{0}",IntRes.Value));
????????????}

????????}


????????
//This?method?prompts?for?a?double?value.
????????
//Pi,Two-pi??are?valid?keywords?that?can?be?entered
????????
//by?the?user?at?the?prompt.
????????[CommandMethod("GetDouble")]?
????????
public?void?DoubleTest()
????????
{
????????????Editor?ed?
=?Application.DocumentManager.MdiActiveDocument.Editor;
????????????PromptDoubleOptions?opt1?
=?new?PromptDoubleOptions("Enter?a?number?or?Pi/Two-pi");
????????????opt1.Keywords.Add(
"Pi");
????????????opt1.Keywords.Add(
"Two-pi");
????????????opt1.AllowNone?
=?false;
????????????opt1.AllowZero?
=?false;
????????????opt1.DefaultValue?
=?1.0;

????????????PromptDoubleResult?doubleRes?
=?ed.GetDouble(opt1);
????????????
if(doubleRes.Status?==?PromptStatus.Keyword)
????????????
{
????????????????
switch?(doubleRes.StringResult)
????????????????
{
????????????????????
case?"Pi":
????????????????????????ed.WriteMessage(
"Value?is?3.14");
????????????????????????
break;
????????????????????
case?"Two-pi":
????????????????????????ed.WriteMessage(
"\nValue?is?6.28");
????????????????????????
break;
????????????????????
default:
????????????????????????ed.WriteMessage(
"\nKeyword?unknown");
????????????????????????
break;
????????????????}

????????????}

????????????
if(doubleRes.Status?!=?PromptStatus.OK)
????????????
{
????????????????ed.WriteMessage(
"\nUser?entered:?"?+?doubleRes.Status.ToString());
????????????}

????????}


????????
//Gets?the?radius?of?the?circle?from?the?user?using?GetDistance?command
????????
//and?draw?the?circle.
????????
//The?user?can?either?specify?the?number?in?the?command?prompt?or
????????
//The?user?can?set?the?distance?(in?this?case?radius?of?circle)?also
????????
//by?specifying?two?locations?on?the?graphics?screen.
????????
//AutoCAD?draws?a?rubber-band?line?from?the?first?point?to
????????
//the?current?crosshair?position?to?help?the?user?visualize?the?distance.
????????[CommandMethod("GetDistance")]?
????????
public?void?DistanceTest()
????????
{
????????????Editor?ed?
=?Application.DocumentManager.MdiActiveDocument.Editor;
????????????PromptDistanceOptions?opt1?
=?new?PromptDistanceOptions("Enter?the?radius?of?the?circle");
????
????????????opt1.AllowNegative?
=?false;
????????????opt1.AllowZero?
=?false;
????????????opt1.AllowNone?
=?false;
????????????opt1.UseDashedLine?
=?true;

????????????PromptDoubleResult?res?
=?ed.GetDistance(opt1);
????????????
????????????
if(res.Status?==?PromptStatus.OK)
????????????
{
????????????????Point3d?center?
=?new?Point3d(9.0,?3.0,?0.0);
????????????????Vector3d?normal?
=?new?Vector3d(0.0,?0.0,?1.0);
????????????????Database?db?
=?Application.DocumentManager.MdiActiveDocument.Database;
????????????????Autodesk.AutoCAD.DatabaseServices.TransactionManager?tm?
=?db.TransactionManager;
????????????????
using?(Transaction?myT?=?tm.StartTransaction())
????????????????
{
????????????????????BlockTable?bt?
=?(BlockTable)tm.GetObject(db.BlockTableId,?OpenMode.ForRead,?false);
????????????????????BlockTableRecord?btr?
=?(BlockTableRecord)tm.GetObject(bt[BlockTableRecord.ModelSpace],?OpenMode.ForWrite,?false);
????????????????????
using?(Circle?pcirc?=?new?Circle(center,?normal,?res.Value))
????????????????????
{
????????????????????????btr.AppendEntity(pcirc);
????????????????????????tm.AddNewlyCreatedDBObject(pcirc,?
true);
????????????????????}

????????????????????myT.Commit();
????????????????}

????????????????
????????????}

????????????
????????}


????

????????
//The?user?is?prompted?to?enter?the?start?angle?and?end?angle?at?the
????????
//command?prompt.??Using?which?an?arc?is?created.

????????
//Not?only?by?entering?the?values?but?The?user?can?set?the?angle?also?by?
????????
//specifying?two?2D?locations?on?the?graphics?screen.?AutoCAD?draws?a
????????
//rubber-band?line?from?the?first?point?to?the?current?crosshair?position?
????????
//to?help?the?user?visualize?the?angle.

????????
//Also?attached?to?this?function?is?the?input?context?reactor?event
????????
//PromptingForAngle?and?PromptedForAngle.?During?ed.GetAngle(),?these
????????
//events?gets?fired.?The?call?back?function?just?remembers?the?prompt?option
????????
//that?the?user?has?set?initially?and?also?the?prompt?result?that?the
????????
//user?sees?after?he?calls?GetAngle()?method.


????????[CommandMethod(
"GetAngle")]?
????????
public?void?AngleTest()
????????
{
????????????Editor?ed?
=?Application.DocumentManager.MdiActiveDocument.Editor;
????????????PromptAngleOptions?opt1?
=?new?PromptAngleOptions("Enter?start?angle?of?the?arc");
????????????
????????????opt1.AllowNone?
=?false;
????????????opt1.UseDashedLine?
=?true;
????????????
????????????
//USAGE?OF?INPUT?CONTEXT?REACTORS
????????????ed.PromptingForAngle?+=?new?PromptAngleOptionsEventHandler(handle_promptangleOptions);
????????????ed.PromptedForAngle?
+=?new?PromptDoubleResultEventHandler(handle_promptAngleResult);
????????????
????????????PromptDoubleResult?startAngle?
=?ed.GetAngle(opt1);
????????????
????????????ed.PromptingForAngle?
-=?new?PromptAngleOptionsEventHandler(handle_promptangleOptions);
????????????ed.PromptedForAngle?
-=?new?PromptDoubleResultEventHandler(handle_promptAngleResult);


????????????opt1.Message?
=?"Enter?end?angle?of?the?arc";
????????????PromptDoubleResult?endAngle?
=?ed.GetAngle(opt1);

????????????PromptDoubleOptions?opt2?
=?new?PromptDoubleOptions("Enter?the?radius?of?the?arc(double)");
????????????opt2.Message?
=?"Enter?the?radius?of?the?arc(double)";
????????????PromptDoubleResult?radius?
=?ed.GetDouble(opt2);

????????????
if(startAngle.Status?==?PromptStatus.OK?&&?endAngle.Status?==?PromptStatus.OK?&&?radius.Status?==?PromptStatus.OK)
????????????
{
????????????????Point3d?center?
=?new?Point3d(30.0,?19.0,?0.0);
????????????????Database?db?
=?Application.DocumentManager.MdiActiveDocument.Database;
????????????????Autodesk.AutoCAD.DatabaseServices.TransactionManager?tm?
=?db.TransactionManager;
????????????????
????????????????
using?(Transaction?myT?=?tm.StartTransaction())
????????????????
{
????????????????????BlockTable?bt?
=?(BlockTable)tm.GetObject(db.BlockTableId,?OpenMode.ForRead,?false);
????????????????????BlockTableRecord?btr?
=?(BlockTableRecord)tm.GetObject(bt[BlockTableRecord.ModelSpace],?OpenMode.ForWrite,?false);
????????????????????
using?(Arc?arc1?=?new?Arc(center,?radius.Value,?startAngle.Value,?endAngle.Value))
????????????????????
{
????????????????????????btr.AppendEntity(arc1);
????????????????????????tm.AddNewlyCreatedDBObject(arc1,?
true);
????????????????????}

????????????????????myT.Commit();
????????????????}

????????????????
????????????}

????????????
else
????????????
{
????????????????ed.WriteMessage(
"Arc?cannot?be?constructed");
????????????}

????????
????????}




????????[CommandMethod(
"useAngle")]?
????????
public?void?UsingAngleOptionsAndResults()
????????
{
????????????Editor?ed?
=?Application.DocumentManager.MdiActiveDocument.Editor;
????????????
//Verify?GetAngle?has?been?ran?once?before?executing?this?one
????????????if?(?useThisAngleOption?==?null?||?useThisAngleResult?==?null?)
????????????
{
????????????????ed.WriteMessage(
"Please?run?GetAngle?command?first");
????????????????
return;
????????????}

????????????
//Using?the?stored?PromptAngleOption.
????????????PromptDoubleResult?res1?=?ed.GetAngle(useThisAngleOption);
????????????
//Using?the?stored?PromptAngleResult.
????????????PromptDoubleResult?res2?=?useThisAngleResult;
????????????
if(res1.Status?==?PromptStatus.OK?&&?res2.Status?==?PromptStatus.OK)
????????????
{
????????????????Database?db?
=?Application.DocumentManager.MdiActiveDocument.Database;
????????????????Autodesk.AutoCAD.DatabaseServices.TransactionManager?tm?
=?db.TransactionManager;
????????????????
????????????????
using?(Transaction?myT?=?tm.StartTransaction())
????????????????
{?????????????
????????????????????BlockTable?bt?
=?(BlockTable)tm.GetObject(db.BlockTableId,OpenMode.ForRead,false);
????????????????????BlockTableRecord?btr?
=?(BlockTableRecord)tm.GetObject(bt[BlockTableRecord.ModelSpace],OpenMode.ForWrite,false);
????????????????????Point3d?center?
=?new?Point3d(30.0,?19.0,?0.0);
????????????????????
using?(Arc?arc1?=?new?Arc(center,?res1.Value,?res2.Value,?5.0))
????????????????????
{
????????????????????????arc1.ColorIndex?
=?3;
????????????????????????btr.AppendEntity(arc1);
????????????????????????myT.AddNewlyCreatedDBObject(arc1,?
true);
????????????????????}

????????????????????myT.Commit();
????????????????}

????????????????
????????????}

????????????
else
????????????
{
????????????????ed.WriteMessage(
"Arc?cannot?be?constructed");
????????????}

????????}


//????????Drawing?a?line?using?the?points?entered?by?the?user.
//????????Prompt?the?user?for?the?start?point?and?end?point?of?the?line.

//????????The?AutoCAD?user?can?specify?the?point?by?entering?a?coordinate?in
//????????the?current?units?format;?The?user?can?specify?the?point?also?by?specifying?
//????????a?location?on?the?graphics?screen.
????????[CommandMethod("GetPoint")]?
????????
public?void?PointTest()
????????
{
????????????Editor?ed?
=?Application.DocumentManager.MdiActiveDocument.Editor;
????????????PromptPointOptions?ptopts?
=?new?PromptPointOptions("Enter?start?point?of?the?line");
????????????ptopts.BasePoint?
=?new?Point3d(1,1,1);
????????????ptopts.UseDashedLine?
=?true;
????????????ptopts.Message?
=?"Enter?start?point?of?the?line";
????????????
????????????ed.PromptingForPoint?
+=?new?PromptPointOptionsEventHandler(handle_promptPointOptions);
????????????ed.PromptedForPoint?
+=?new?PromptPointResultEventHandler(handle_promptPointResult);
????????????PromptPointResult?ptRes?
=?ed.GetPoint(ptopts);
????????????ed.PromptingForPoint?
-=?new?PromptPointOptionsEventHandler(handle_promptPointOptions);
????????????ed.PromptedForPoint?
-=?new?PromptPointResultEventHandler(handle_promptPointResult);
????????????

????????????Point3d?start?
=?ptRes.Value;
????????????
if(ptRes.Status?==?PromptStatus.Cancel)
????????????
{
????????????????ed.WriteMessage(
"Taking?(0,0,0)?as?the?start?point");
????????????}


????????????ptopts.Message?
="Enter?end?point?of?the?line:?";
????????????ptRes?
=?ed.GetPoint(ptopts);
????????????Point3d?end?
=?ptRes.Value;
????????????
if(ptRes.Status?==?PromptStatus.Cancel)
????????????
{
????????????????ed.WriteMessage(
"Taking?(0,0,0)?as?the?end?point");
????????????}

????????????
????????????Database?db?
=?Application.DocumentManager.MdiActiveDocument.Database;
????????????Autodesk.AutoCAD.DatabaseServices.TransactionManager?tm?
=?db.TransactionManager;
????????????
????????????
using?(Transaction?myT?=?tm.StartTransaction())
????????????
{???
????????????????BlockTable?bt?
=?(BlockTable)tm.GetObject(db.BlockTableId,OpenMode.ForRead,false);
????????????????BlockTableRecord?btr?
=?(BlockTableRecord)tm.GetObject(bt[BlockTableRecord.ModelSpace],OpenMode.ForWrite,false);
????????????????
using?(Line?myline?=?new?Line(start,?end))
????????????????
{
????????????????????btr.AppendEntity(myline);
????????????????????tm.AddNewlyCreatedDBObject(myline,?
true);
????????????????}

????????????????myT.Commit();
????????????}

????????????
????????}



????????[CommandMethod(
"usepoint")]?
????????
public?void?UsingPointOptionsAndResults()
????????
{
????????????Editor?ed?
=?Application.DocumentManager.MdiActiveDocument.Editor;
????????????
//Verify?GetPoint?has?been?ran?once?before?executing?this?one
????????????if?(?useThisPointOption?==?null?||?useThisPointResult?==?null?)
????????????
{
????????????????ed.WriteMessage(
"Please?run?GetPoint?command?first");
????????????????
return?;
????????????}

????????????
//Using?the?stored?PromptPointOption.
????????????PromptPointResult?res1?=?ed.GetPoint(useThisPointOption);
????????????
//Using?the?stored?PromptPointResult.
????????????PromptPointResult?res2?=?useThisPointResult;
????????????
????????????
if(res1.Status?!=?PromptStatus.Cancel?&&?res2.Status?!=?PromptStatus.Cancel)
????????????
{
????????????????Point3d?start?
=?res1.Value;
????????????????Point3d?end?
=?res2.Value;
????????????????Database?db?
=?Application.DocumentManager.MdiActiveDocument.Database;
????????????????Autodesk.AutoCAD.DatabaseServices.TransactionManager?tm?
=?db.TransactionManager;
????????????????
using?(Transaction?myT?=?tm.StartTransaction())
????????????????
{?????????????
????????????????????BlockTable?bt?
=?(BlockTable)tm.GetObject(db.BlockTableId,OpenMode.ForRead,false);
????????????????????BlockTableRecord?btr?
=?(BlockTableRecord)tm.GetObject(bt[BlockTableRecord.ModelSpace],OpenMode.ForWrite,false);
????????????????????
using?(Line?myline?=?new?Line(start,?end))
????????????????????
{
????????????????????????myline.ColorIndex?
=?3;
????????????????????????btr.AppendEntity(myline);
????????????????????????myT.AddNewlyCreatedDBObject(myline,?
true);
????????????????????}

????????????????????myT.Commit();
????????????????}

????????????????
????????????}

????????}

????????
????????
//Here?the?user?is?prompted?for?a?string?that?could?be?used?as?a?keyword.
????????
//We?then?test?to?see?if?the?user?entered?string?has?been?taken?as?a?valid?
????????
//keyword?or?not?by?asking?the?user?to?enter?that?string?as?a?keyword?in?the
????????
//command?prompt.?If?it?is?not?a?valid?one?then?the?user?is?prompted?for?a?
????????
//different?value?(which?is?a?bug).
????????[CommandMethod("GetKW")]?
????????
public?void?KWandStringTest()
????????
{
????????????Editor?ed?
=?Application.DocumentManager.MdiActiveDocument.Editor;
????????????PromptStringOptions?stropts?
=?new?PromptStringOptions("Enter?a?string?you?want?to?use?as?keyword");
????????????PromptKeywordOptions?kwopts?
=?new?PromptKeywordOptions("Enter?a?string?you?want?to?use?as?keyword");
????????????stropts.AllowSpaces?
=?false;
????????????PromptResult?str?
=?ed.GetString(stropts);
????????????kwopts.Keywords.Add(str.StringResult);
????????????kwopts.Keywords.Add(
"onemore");
????????????kwopts.Message?
=?"Enter?the?word?that?u?just?enterd?to?test?if?its?a?valid?keyword?or?not";
????????????PromptResult?kw?
=?ed.GetKeywords(kwopts);
????????????
if(kw.Status?==?PromptStatus.OK)
????????????
{
????????????????ed.WriteMessage(
"You?entered?a?valid?keyword");
????????????}

????????????
else
????????????
{
????????????????ed.WriteMessage(
"You?didn't?enter?a?valid?keyword:?"+kw.Status.ToString());
????????????}

????????}


????????
//Try?to?draw?a?few?entities?in?the?drawing?for?the?user?to?select.
????????
//It?prompts?the?user?to?select?some?entities?and?finally?types
????????
//the?name?of?the?selected?entity?at?the?command?prompt.
????????
//Also?added?the?two?input?context?reactor?events:
????????
//PromptingForEntity?and?PromptedForEntity
????????[CommandMethod("Getentity")]?
????????
public?void?EntityTest()
????????
{
????????????Editor?ed?
=?Application.DocumentManager.MdiActiveDocument.Editor;
????????????PromptEntityOptions?entopts?
=?new?PromptEntityOptions("Pick?an?entity?of?your?choice?from?the?drawing");
????????????entopts.Message?
=?"Pick?an?entity?of?your?choice?from?the?drawing";
????????????PromptEntityResult?ent
=null;
????????????
//ADDED?INPUT?CONTEXT?REACTOR????
????????????ed.PromptingForEntity?+=?new?PromptEntityOptionsEventHandler(handle_promptEntityOptions);
????????????ed.PromptedForEntity?
+=?new?PromptEntityResultEventHandler(handle_promptEntityResult);
????????????????
????????????
try
????????????
{
????????????????ent?
=?ed.GetEntity(entopts);
????????????}

????????????
catch
????????????
{
????????????????ed.WriteMessage(
"You?did?not?select?a?valid?entity");
????????????????ed.PromptingForEntity?
-=?new?PromptEntityOptionsEventHandler(handle_promptEntityOptions);
????????????????ed.PromptedForEntity?
-=?new?PromptEntityResultEventHandler(handle_promptEntityResult);
????????????????????
????????????}

????????????ed.PromptingForEntity?
-=?new?PromptEntityOptionsEventHandler(handle_promptEntityOptions);
????????????ed.PromptedForEntity?
-=?new?PromptEntityResultEventHandler(handle_promptEntityResult);
????
????????????
if(ent.Status?!=?PromptStatus.Error)
????????????
{
????????????????ObjectId?entid?
=?ent.ObjectId;
????????????????Database?db?
=?Application.DocumentManager.MdiActiveDocument.Database;
????????????????Autodesk.AutoCAD.DatabaseServices.TransactionManager?tm?
=?db.TransactionManager;
????????????????
using?(Transaction?myT?=?tm.StartTransaction())
????????????????
{?????????????
????????????????????Entity?entity?
=?(Entity)tm.GetObject(entid,OpenMode.ForRead,true);
????????????????????ed.WriteMessage(
"You?selected:?"+entity.GetType().FullName);
????????????????????myT.Commit();
????????????????}

????????????}

????????????
????????}


????

????????
//This?method?just?makes?use?of?the?entity?option?and?entity?result
????????
//that?was?stored?in?a?static?variable?when?the?PromptingForEntity
????????
//and?PromptingForEntity?events?where?fired?from?EntityTest()?function.
????????[CommandMethod("useentity")]?
????????
public?void?UsingEntityOptionsAndResults()
????????
{
????????????Editor?ed?
=?Application.DocumentManager.MdiActiveDocument.Editor;
????????????
//Using?the?stored?PromptEntityOption.
????????????PromptEntityResult?res1?=?ed.GetEntity(useThisEntityOption);
????????????
//Using?the?stored?PromptEntityResult.
????????????PromptEntityResult?res2?=?useThisEntityResult;
????????????ed.WriteMessage(
"\nCHANGING?THE?ALREADY?SELECTED?ENTITIES?COLORS?TO?GREEN");
????????????
if(res2.Status?!=?PromptStatus.Error)
????????????
{
????????????????ObjectId?entid?
=?res2.ObjectId;
????????????????Database?db?
=?Application.DocumentManager.MdiActiveDocument.Database;
????????????????Autodesk.AutoCAD.DatabaseServices.TransactionManager?tm?
=?db.TransactionManager;
????????????????ObjectId?nowSelEntid?
=?res1.ObjectId;
????????????????
????????????????
using?(Transaction?myT?=?tm.StartTransaction())
????????????????
{?????????????
????????????????????Entity?Oldentity?
=?(Entity)tm.GetObject(entid,OpenMode.ForWrite,true);
????????????????????Oldentity.ColorIndex?
=?2;
????????????????????ed.WriteMessage(
"\nYou?Now?selected:?"+Oldentity.GetType().FullName);
????????????????????myT.Commit();
????????????????}

????????????}


????????}


????????
//Try?to?draw?a?few?nested?entities?like?blocks?and?xrefs?in?the?drawing?for?the?user?to?select.
????????
//if?the?user?selects?a?nested?entity?then?the?name?of?the?nested?entity?is?displayed.
????????
//Finally?after?the?user?is?done?selecting?the?entities,?a?non?interactive?selection?is?made
????????
//at?the?point?30.4,11.6,0?and?the?name?of?the?nested?entity?if?any?is?displayed.
????????[CommandMethod("GetNestentity")]?
????????
public?void?NestedEntityTest()
????????
{
????????????ObjectIdCollection?coll?
=?new?ObjectIdCollection();
????????????Editor?ed?
=?Application.DocumentManager.MdiActiveDocument.Editor;
????????????PromptNestedEntityOptions?entopts?
=?new?PromptNestedEntityOptions("prompt?nested?entity");
????????????entopts.AllowNone?
=?true;
????????????entopts.Keywords.Add(
"Done");
????????????PromptNestedEntityResult?ent
=?null;
????????????Database?db?
=?Application.DocumentManager.MdiActiveDocument.Database;
????????????Autodesk.AutoCAD.DatabaseServices.TransactionManager?tm?
=?db.TransactionManager;
????????????
????????????
using?(Transaction?myT?=?tm.StartTransaction())
????????????
{?????
????????????????
while(true)
????????????????
{

????????????????????entopts.Message?
=?"\nPick?an?entity?of?your?choice?from?the?drawing?or?type?Done";

????????????????????
try
????????????????????
{
????????????????????????ent?
=?ed.GetNestedEntity(entopts);
????????????????????}

????????????????????
catch
????????????????????
{
????????????????????????ed.WriteMessage(
"\nYou?did?not?select?a?valid?nested?entity");
????????????????????????
break;
????????????????????}

????????????????????
if(ent.Status?==?PromptStatus.Keyword)
????????????????????
{
????????????????????????
if(ent.StringResult.Equals("Done"))
????????????????????????????
break;
????????????????????}


????????????????????
try
????????????????????
{
????????????????????????
if(ent.GetContainers().Length?>?0)
????????????????????????
{
????????????????????????????Entity?entity;
????????????????????????????
foreach(ObjectId?oid?in?ent.GetContainers())
????????????????????????????
{
????????????????????????????????entity?
=?(Entity)tm.GetObject(oid,OpenMode.ForRead,true);
????????????????????????????????ed.WriteMessage(
"You?selected:?"+entity.GetType().FullName);
????????????????????????????}

????????????????????????????
break;
????????????????????????}

????????????????????????
else
????????????????????????
{
????????????????????????????ed.WriteMessage(
"You?did?not?select?any?nested?entity");
????????????????????????}

????????????????????}

????????????????????
catch
????????????????????
{
????????????????????????ed.WriteMessage(
"You?are?Done?or?did?not?select?any?nested?entity");
????????????????????????myT.Commit();
????????????????????????
return;
????????????????????}


????????????????}


????????????????entopts.NonInteractivePickPoint?
=?new?Point3d(30.4,11.6,0);
????????????????entopts.UseNonInteractivePickPoint?
=?true;

????????????????
try
????????????????
{
????????????????????ent?
=?ed.GetNestedEntity(entopts);
????????????????????
if(ent.GetContainers().Length?>?0)
????????????????????
{
????????????????????????Entity?entity;
????????????????????????
foreach(ObjectId?oid?in?ent.GetContainers())
????????????????????????
{
????????????????????????????entity?
=?(Entity)tm.GetObject(oid,OpenMode.ForRead,true);
????????????????????????????ed.WriteMessage(entity.GetType().FullName
+"?has?been?selected");
????????????????????????}

????????????????????????}

????????????????????
else
????????????????????
{
????????????????????????ed.WriteMessage(
"No?nested?entity?was?selected");
????????????????????}

????????????????}

????????????????
catch
????????????????
{
????????????????????ed.WriteMessage(
"\nNo?entity?was?selected");
????????????????????
????????????????}

????????????????myT.Commit();
????????????}

????????????????
????????}

????????
private?static?void?handle_promptEntityOptions(object?sender,?PromptEntityOptionsEventArgs?e)
????????
{
????????????useThisEntityOption?
=?e.Options;

????????}

????????
private?static?void?handle_promptEntityResult(object?sender,?PromptEntityResultEventArgs?e)
????????
{
????????????useThisEntityResult?
=?e.Result;

????????}

????????
private?static?void?handle_promptPointOptions(object?sender,?PromptPointOptionsEventArgs?e)
????????
{
????????????useThisPointOption?
=?e.Options;

????????}

????????
private?static?void?handle_promptPointResult(object?sender,?PromptPointResultEventArgs?e)
????????
{
????????????useThisPointResult?
=?e.Result;

????????}

????????
private?static?void?handle_promptangleOptions(object?sender,?PromptAngleOptionsEventArgs?e)
????????
{
????????????useThisAngleOption?
=?e.Options;

????????}

????????
private?static?void?handle_promptAngleResult(object?sender,?PromptDoubleResultEventArgs?e)
????????
{
????????????useThisAngleResult?
=?e.Result;
????????}


????}

}



SelectionSet - .NET API Sample

?(C) Copyright 2004-2006 by Autodesk, Inc.

This sample demonstrates the basics of using the Selectionset .NET API with AutoCAD.? It has the following commnads:

SSet - this command allows the user to do simple selection of entities and ignores
?????? all entities other than circles that are red in color.

Single - This command allows only a single entity to be picked

Implied - This command demonstrates Implied pick

CWindow? - This command demonstrates the Cwindow Selection. For this command to work, AutoCAD elements must be available
?????????? within the boundary limits 1.0,1.0,0.0 and 10.0,10.0,0.0

CPolygon - This command demonstrates CPolygon selection

OptionSel - This command has a number of keywords attached to the selection.
???????????? Based on the keyword that user enters, it does either
???????????? fence,window,windowpolygon,lastentitySelection,PreviousSelection.

SSetReactors - This command demonstrates some selection Related input context
?????????????? reactors. It exercises promptingForSelection, PromptedForSelection
?????????????? and SelectionAdded events of the editor.


useSelection - This command helps to use the previous selection options and
?????????????? selection Results that we had during the execution of SSetReactors
?????????????? command. It demonstrates how to use PromptingForSelection and
?????????????? PromptedForSelection events.

To run the sample:? Build the application adding acdbmgd.dll and acmgd.dll as references, and use NETLOAD command to load selectionset.dll from the \bin subfolder.

?

Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.EditorInput


Namespace Selection
??? _

??? Public Class AcEdSSGetCommand

??????? Shared SelentityCount As Integer = 0
??????? Shared UseThisSelectionResult As PromptSelectionResult
??????? Shared UseThisSelectionOption As PromptSelectionOptions = Nothing

??????? 'This command does a simple selection and ignores all
??????? 'entities other than red circles
??????? <CommandMethod("SSet")> _
??????? Public Sub ssGetFilter()
??????????? 'Setup
??????????? Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor

??????????? 'Declare our filter entries this way.
??????????? 'We build them the same way in ObjectARX.
??????????? 'DxfCode.Start (equal to 0) - This is for 'Entity Name'
??????????? 'DxfCode.Color is for ACI color - 1 = Red
??????????? Dim values() As TypedValue = { _
??????????????? New TypedValue(DxfCode.Start, "CIRCLE"), _
??????????????? New TypedValue(DxfCode.Color, 1) _
??????????????? }
??????????? Dim sfilter As New SelectionFilter(values) ' Create the filter using our values...

??????????? 'Set the selection options
??????????? Dim SelOpts As New PromptSelectionOptions()
??????????? SelOpts.MessageForAdding = "Select Red Circles:"
??????????? SelOpts.AllowDuplicates = True
??????????? 'Make the selection:
??????????? Dim res As PromptSelectionResult = ed.GetSelection(SelOpts, sfilter)

??????????? If Not res.Status = PromptStatus.OK Then Return

??????????? Dim SS As Autodesk.AutoCAD.EditorInput.SelectionSet = res.Value
??????????? Dim idarray As ObjectId() = SS.GetObjectIds()
??????????? Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
??????????? Dim tm As Autodesk.AutoCAD.DatabaseServices.TransactionManager = db.TransactionManager
??????????? 'start a transaction
??????????? Dim myT As Transaction = tm.StartTransaction()
??????????? Try
??????????????? Dim id As ObjectId
??????????????? For Each id In idarray
??????????????????? Dim entity As Entity = tm.GetObject(id, OpenMode.ForRead, True)
??????????????????? ed.WriteMessage((ControlChars.Lf + "You selected: " + entity.GetType().FullName))
??????????????? Next id
??????????? Finally
??????????????? myT.Dispose()
??????????? End Try
??????? End Sub

??????? 'This command allows only a single entity to be picked
??????? <CommandMethod("single")> _
??????? Public Sub singlePick()
??????????? Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
??????????? Dim Opts As New PromptSelectionOptions()
??????????? Opts.SingleOnly = True
??????????? Opts.MessageForAdding = "Select a single entity"
??????????? Dim res As PromptSelectionResult = ed.GetSelection(Opts)
??????????? If res.Status = PromptStatus.Error Then
??????????????? Return
??????????? End If
??????????? Dim SS As Autodesk.AutoCAD.EditorInput.SelectionSet = res.Value
??????????? Dim idarray As ObjectId() = SS.GetObjectIds()
??????????? Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
??????????? Dim tm As Autodesk.AutoCAD.DatabaseServices.TransactionManager = db.TransactionManager

??????????? Dim myT As Transaction = tm.StartTransaction()
??????????? Try
??????????????? Dim id As ObjectId
??????????????? For Each id In idarray
??????????????????? Dim entity As Entity = tm.GetObject(id, OpenMode.ForWrite, True)
??????????????????? ed.WriteMessage((ControlChars.Lf + "You selected: " + entity.GetType().FullName))
??????????????? Next id
??????????? Finally
??????????????? myT.Dispose()
??????????? End Try
??????? End Sub 'singlePick


??????? 'This command demonstrates Implied pick
??????? <CommandMethod("Implied", CommandFlags.UsePickSet)> _
??????? Public Sub ImpliedPick()
??????????? Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
??????????? Dim res As PromptSelectionResult = ed.SelectImplied()
??????????? If res.Status = PromptStatus.Error Then Return
??????????? Dim SS As Autodesk.AutoCAD.EditorInput.SelectionSet = res.Value
??????????? Dim idarray As ObjectId() = SS.GetObjectIds()
??????????? Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
??????????? Dim tm As Autodesk.AutoCAD.DatabaseServices.TransactionManager = db.TransactionManager

??????????? Dim myT As Transaction = tm.StartTransaction()
??????????? Try
??????????????? Dim id As ObjectId
??????????????? For Each id In idarray
??????????????????? Dim entity As Entity = tm.GetObject(id, OpenMode.ForWrite, True)
??????????????????? ed.WriteMessage((ControlChars.Lf + "You selected: " + entity.GetType().FullName))
??????????????? Next id
??????????? Finally
??????????????? myT.Dispose()
??????????? End Try
??????? End Sub 'ImpliedPick


??????? 'This command demonstrates the Cwindow Selection
??????? <CommandMethod("CWindow")> _
?????? Public Sub CrossWindow()
??????????? Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
??????????? Dim res As PromptSelectionResult = ed.SelectCrossingWindow(New Point3d(1.0, 1.0, 0), New Point3d(10.0, 10.0, 0))
??????????? If res.Status = PromptStatus.Error Then
??????????????? Return
??????????? End If
??????????? Dim SS As Autodesk.AutoCAD.EditorInput.SelectionSet = res.Value
??????????? Dim idarray As ObjectId() = SS.GetObjectIds()
??????????? Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
??????????? Dim tm As Autodesk.AutoCAD.DatabaseServices.TransactionManager = db.TransactionManager
??????????? 'start a transaction
??????????? Dim myT As Transaction = tm.StartTransaction()
??????????? Try
??????????????? Dim id As ObjectId
??????????????? For Each id In idarray
??????????????????? Dim entity As Entity = tm.GetObject(id, OpenMode.ForWrite, True)
??????????????????? ed.WriteMessage((ControlChars.Lf + "You selected: " + entity.GetType().FullName))
??????????????? Next id
??????????? Finally
??????????????? myT.Dispose()
??????????? End Try
??????? End Sub 'CrossWindow


??????? 'This command demonstrates CPolygon selection
??????? <CommandMethod("CPolygon")> _
??????? Public Sub CrossPlygon()
??????????? Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
??????????? Dim values(4) As Point3d
??????????? values(0) = New Point3d(1.0, 1.0, 0.0)
??????????? values(1) = New Point3d(1.0, 50.0, 0.0)
??????????? values(2) = New Point3d(50.0, 50.0, 0.0)
??????????? values(3) = New Point3d(50.0, 1.0, 0.0)

??????????? Dim polygon As New Point3dCollection(values)
??????????? Dim res As PromptSelectionResult = ed.SelectCrossingPolygon(polygon)
??????????? If res.Status = PromptStatus.Error Then
??????????????? Return
??????????? End If
??????????? Dim SS As Autodesk.AutoCAD.EditorInput.SelectionSet = res.Value
??????????? Dim idarray As ObjectId() = SS.GetObjectIds()
??????????? Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
??????????? Dim tm As Autodesk.AutoCAD.DatabaseServices.TransactionManager = db.TransactionManager
??????????? 'start a transaction
??????????? Dim myT As Transaction = tm.StartTransaction()
??????????? Try
??????????????? Dim id As ObjectId
??????????????? For Each id In idarray
??????????????????? Dim entity As Entity = tm.GetObject(id, OpenMode.ForWrite, True)
??????????????????? ed.WriteMessage((ControlChars.Lf + "You selected: " + entity.GetType().FullName))
??????????????? Next id
??????????? Finally
??????????????? myT.Dispose()
??????????? End Try
??????? End Sub 'CrossPlygon

??????? 'This command has a number of keywords attached to the selection.
??????? 'Based on the keyword that user enters, it does either fence,window,windowpolygon,
??????? 'lastentitySelection,PreviousSelection
??????? <CommandMethod("OptionSel")> _
??????? Public Sub OptionSel()
??????????? Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
??????????? Dim Opts As New PromptSelectionOptions()
??????????? Opts.Keywords.Add("myFence")
??????????? Opts.Keywords.Add("myWindow")
??????????? Opts.Keywords.Add("myWpoly")
??????????? ' Opts.Keywords.Add("Implied")
??????????? Opts.Keywords.Add("myLastSel")
??????????? Opts.Keywords.Add("myPrevSel")

??????????? AddHandler Opts.KeywordInput, AddressOf handle_KeywordInput
??????????? Dim res As PromptSelectionResult = ed.GetSelection(Opts)
??????????? If res.Status = PromptStatus.OK Then
??????????????? Dim SS As Autodesk.AutoCAD.EditorInput.SelectionSet = res.Value
??????????????? Dim idarray As ObjectId() = SS.GetObjectIds()
??????????????? Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
??????????????? Dim tm As Autodesk.AutoCAD.DatabaseServices.TransactionManager = db.TransactionManager

??????????????? Dim myT As Transaction = tm.StartTransaction()
??????????????? Try
??????????????????? Dim id As ObjectId
??????????????????? For Each id In idarray
??????????????????????? Dim entity As Entity = tm.GetObject(id, OpenMode.ForWrite, True)
??????????????????????? ed.WriteMessage((ControlChars.Lf + "You selected: " + entity.GetType().FullName))
??????????????????? Next id
??????????????? Finally
??????????????????? myT.Dispose()
??????????????? End Try
??????????? End If
??????? End Sub 'OptionSel

??????? Private Shared Sub handle_KeywordInput(ByVal sender As Object, ByVal e As SelectionTextInputEventArgs)
??????????? If e.Input.CompareTo("myFence") = 0 Then
??????????????? Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
??????????????? Dim values(4) As Point3d
??????????????? values(0) = New Point3d(5.0, 5.0, 0.0)
??????????????? values(1) = New Point3d(13.0, 15.0, 0.0)
??????????????? values(2) = New Point3d(12.0, 9.0, 0.0)
??????????????? values(3) = New Point3d(5.0, 5.0, 0.0)

??????????????? Dim Fence As New Point3dCollection(values)
??????????????? Dim res As PromptSelectionResult = ed.SelectFence(Fence)
??????????????? If res.Status = PromptStatus.Error Then
??????????????????? Return
??????????????? End If
??????????????? Dim SS As Autodesk.AutoCAD.EditorInput.SelectionSet = res.Value
??????????????? Dim idarray As ObjectId() = SS.GetObjectIds()
??????????????? e.AddObjects(idarray)
??????????? Else
??????????????? If e.Input.CompareTo("myWindow") = 0 Then
??????????????????? Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
??????????????????? Dim res As PromptSelectionResult = ed.SelectWindow(New Point3d(1.0, 1.0, 0.0), New Point3d(30.0, 20.0, 0.0))
??????????????????? If res.Status = PromptStatus.Error Then
??????????????????????? Return
??????????????????? End If
??????????????????? Dim SS As Autodesk.AutoCAD.EditorInput.SelectionSet = res.Value
??????????????????? Dim idarray As ObjectId() = SS.GetObjectIds()
??????????????????? e.AddObjects(idarray)
??????????????? Else
??????????????????? If e.Input.CompareTo("myWpoly") = 0 Then
??????????????????????? Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
??????????????????????? Dim values(4) As Point3d
??????????????????????? values(0) = New Point3d(5.0, 5.0, 0.0)
??????????????????????? values(1) = New Point3d(13.0, 15.0, 0.0)
??????????????????????? values(2) = New Point3d(12.0, 9.0, 0.0)
??????????????????????? values(3) = New Point3d(5.0, 5.0, 0.0)

??????????????????????? Dim Polygon As New Point3dCollection(values)
??????????????????????? Dim res As PromptSelectionResult = ed.SelectWindowPolygon(Polygon)
??????????????????????? If res.Status = PromptStatus.Error Then
??????????????????????????? Return
??????????????????????? End If
??????????????????????? Dim SS As Autodesk.AutoCAD.EditorInput.SelectionSet = res.Value
??????????????????????? Dim idarray As ObjectId() = SS.GetObjectIds()
??????????????????????? e.AddObjects(idarray)

??????????????????? Else
??????????????????????? If e.Input.CompareTo("myLastSel") = 0 Then
??????????????????????????? Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
??????????????????????????? Dim res As PromptSelectionResult = ed.SelectLast()
??????????????????????????? If res.Status = PromptStatus.Error Then
??????????????????????????????? Return
??????????????????????????? End If
??????????????????????????? Dim SS As Autodesk.AutoCAD.EditorInput.SelectionSet = res.Value
??????????????????????????? Dim idarray As ObjectId() = SS.GetObjectIds()
??????????????????????????? e.AddObjects(idarray)
??????????????????????? Else
??????????????????????????? If e.Input.CompareTo("myPrevSel") = 0 Then
??????????????????????????????? Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
??????????????????????????????? Dim res As PromptSelectionResult = ed.SelectPrevious()
??????????????????????????????? If res.Status = PromptStatus.Error Then
??????????????????????????????????? Return
??????????????????????????????? End If
??????????????????????????????? Dim SS As Autodesk.AutoCAD.EditorInput.SelectionSet = res.Value
??????????????????????????????? Dim idarray As ObjectId() = SS.GetObjectIds()
??????????????????????????????? e.AddObjects(idarray)
??????????????????????????? End If
??????????????????????? End If
??????????????????? End If
??????????????? End If
??????????? End If
??????? End Sub


??????? 'This command demonstrates some selection Related input context reactors.
??????? 'It exercises promptingForSelection, PromptedForSelection and SelectionAdded
??????? 'events of the editor.

??????? <CommandMethod("SSetReactors")> _
????????? Public Sub SSetAddFilterTest()
??????????? Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
??????????? Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
??????????? Dim tm As Autodesk.AutoCAD.DatabaseServices.TransactionManager = db.TransactionManager

??????????? Dim SelOpts As New PromptSelectionOptions()
??????????? SelOpts.AllowDuplicates = True
??????????? AddHandler ed.PromptingForSelection, AddressOf handle_promptSelectionOptions
??????????? AddHandler ed.PromptedForSelection, AddressOf handle_promptSelectionResult
??????????? AddHandler ed.SelectionAdded, AddressOf handle_SelectionAdded
??????????? Dim SelRes As PromptSelectionResult = ed.GetSelection(SelOpts)
??????????? RemoveHandler ed.SelectionAdded, AddressOf handle_SelectionAdded
??????????? RemoveHandler ed.PromptingForSelection, AddressOf handle_promptSelectionOptions
??????????? RemoveHandler ed.PromptedForSelection, AddressOf handle_promptSelectionResult


??????????? If SelRes.Status = PromptStatus.OK Then
??????????????? Dim SS1 As Autodesk.AutoCAD.EditorInput.SelectionSet = SelRes.Value
??????????????? Dim idarray1 As ObjectId() = SS1.GetObjectIds()

??????????????? Dim myT As Transaction = tm.StartTransaction()
??????????????? Try
??????????????????? Dim id As ObjectId
??????????????????? For Each id In idarray1
??????????????????????? Dim entity As Entity = tm.GetObject(id, OpenMode.ForWrite, True)
??????????????????????? ed.WriteMessage((ControlChars.Lf + "You selected: " + entity.GetType().FullName))
??????????????????? Next id
??????????????? Finally
??????????????????? myT.Dispose()
??????????????? End Try
??????????? End If
??????? End Sub 'SSetAddFilterTest

?


??????? Private Shared Sub handle_SelectionAdded(ByVal sender As Object, ByVal e As SelectionAddedEventArgs)
??????????? Dim ss As Autodesk.AutoCAD.EditorInput.SelectionSet = e.Selection
??????????? SelentityCount += 1
??????????? If SelentityCount = 2 Then
??????????????? e.Remove(0)
??????????? End If
??????? End Sub 'handle_SelectionAdded

??????? Private Shared Sub handle_promptSelectionResult(ByVal sender As Object, ByVal e As PromptSelectionResultEventArgs)
??????????? UseThisSelectionResult = e.Result
??????? End Sub 'handle_promptSelectionResult


??????? Private Shared Sub handle_promptSelectionOptions(ByVal sender As Object, ByVal e As PromptSelectionOptionsEventArgs)
??????????? UseThisSelectionOption = e.Options
??????? End Sub 'handle_promptSelectionOptions

??????? 'This command helps to use the previous selection options and selection Results
??????? 'that we had during the execution of SSetReactors command. It demonstrates how to
??????? 'use PromptingForSelection and PromptedForSelection events.
??????? <CommandMethod("useSelection")> _
???????? Public Sub UsingSelectionOptionsAndResults()

??????????? Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
??????????? Dim tm As Autodesk.AutoCAD.DatabaseServices.TransactionManager = db.TransactionManager
??????????? 'start a transaction
??????????? Dim myT As Transaction = tm.StartTransaction()
??????????? Try

??????????????? Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
??????????????? If UseThisSelectionOption Is Nothing Then
??????????????????? Exit Sub
??????????????? End If
??????????????? Dim res2 As PromptSelectionResult = ed.GetSelection(UseThisSelectionOption)
??????????????? Dim res1 As PromptSelectionResult = UseThisSelectionResult

??????????????? Dim SS2 As Autodesk.AutoCAD.EditorInput.SelectionSet = res2.Value

??????????????? Dim idarray2 As ObjectId() = SS2.GetObjectIds()
??????????????? Dim SS1 As Autodesk.AutoCAD.EditorInput.SelectionSet = res1.Value
??????????????? Dim idarray1 As ObjectId() = SS1.GetObjectIds()
??????????????? Dim id As ObjectId
??????????????? For Each id In idarray1
??????????????????? Dim entity As Entity = tm.GetObject(id, OpenMode.ForWrite, True)
??????????????????? ed.WriteMessage((ControlChars.Lf + "You selected:" + entity.GetType().FullName))
??????????????? Next id

??????????????? Dim id1 As ObjectId
??????????????? For Each id1 In idarray2
??????????????????? Dim entity2 As Entity = tm.GetObject(id1, OpenMode.ForWrite, True)
??????????????????? ed.WriteMessage((ControlChars.Lf + "You selected:" + entity2.GetType().FullName))
??????????????? Next id1
??????????? Finally
??????????????????? myT.Dispose()
??????????? End Try
??????? End Sub 'UsingSelectionOptionsAndResults

??? End Class 'AcEdSSGetCommand
End Namespace 'Selection

?

?

以上實例見objectarx sdk \sample\dotnet

?

posted on 2006-07-03 16:08 夢在天涯 閱讀(2832) 評論(0)  編輯 收藏 引用 所屬分類: ARX/DBX

公告

EMail:itech001#126.com

導航

統計

  • 隨筆 - 461
  • 文章 - 4
  • 評論 - 746
  • 引用 - 0

常用鏈接

隨筆分類

隨筆檔案

收藏夾

Blogs

c#(csharp)

C++(cpp)

Enlish

Forums(bbs)

My self

Often go

Useful Webs

Xml/Uml/html

搜索

  •  

積分與排名

  • 積分 - 1811979
  • 排名 - 5

最新評論

閱讀排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
      <noscript id="pjuwb"></noscript>
            <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
              <dd id="pjuwb"></dd>
              <abbr id="pjuwb"></abbr>
              欧美日韩在线不卡一区| 国产色综合网| 欧美日韩中文在线| 亚洲成色最大综合在线| 久久精品人人做人人爽电影蜜月| 亚洲国产精品va| 久久九九99视频| 好男人免费精品视频| 久久国产精品亚洲77777| 亚洲欧美视频一区| 国产亚洲精品bv在线观看| 欧美影视一区| 性伦欧美刺激片在线观看| 国产日韩欧美不卡| 久久久噜噜噜| 久久资源在线| 欧美在线在线| 一区二区在线视频播放| 久久久国产精品一区二区三区| 亚洲一区黄色| 韩国欧美国产1区| 欧美sm视频| 欧美精品入口| 性欧美videos另类喷潮| 久久xxxx精品视频| 91久久精品网| 正在播放欧美一区| 国产日韩1区| 免费在线国产精品| 欧美h视频在线| 亚洲性xxxx| 性欧美18~19sex高清播放| 国模一区二区三区| 亚洲国产一区二区三区a毛片| 欧美黄在线观看| 亚洲欧美日韩精品久久久| 欧美专区18| 亚洲精品激情| 亚洲自拍另类| 91久久久久久久久| 亚洲在线一区二区三区| 一区二区亚洲精品| 日韩视频不卡| 国产亚洲综合在线| 欧美国内亚洲| 国产精品日韩欧美一区| 欧美www在线| 国产精品美女www爽爽爽视频| 男人的天堂亚洲| 欧美亚洲第一区| 免费欧美高清视频| 国产精品伦一区| 亚洲高清在线视频| 国产精品一级久久久| 亚洲激情二区| 精品91在线| 亚洲影视在线播放| 99av国产精品欲麻豆| 亚欧成人精品| 亚洲一级黄色| 欧美福利视频一区| 久久视频精品在线| 国产精品国产| 亚洲三级免费观看| 国内精品写真在线观看| 亚洲最新在线视频| 亚洲国产成人tv| 午夜久久久久久| 亚洲一区二区在| 欧美黄色成人网| 猛干欧美女孩| 国产视频久久久久久久| 中文av一区二区| 99精品欧美一区二区三区| 久久野战av| 久久艳片www.17c.com| 国产视频一区二区在线观看| 一级成人国产| 一本久道久久综合中文字幕| 久久综合一区二区三区| 美女主播一区| 欧美成人中文字幕| 麻豆精品国产91久久久久久| 国产日韩精品综合网站| 亚洲欧美日产图| 欧美一级视频| 国产欧美日韩一区二区三区在线| 亚洲精品视频在线播放| 亚洲九九九在线观看| 欧美成人精品不卡视频在线观看| 久久中文字幕导航| 极品尤物久久久av免费看| 欧美一区二区在线| 久久精品一区二区| 韩国v欧美v日本v亚洲v| 久久国产视频网站| 玖玖玖国产精品| 亚洲高清影视| 欧美韩日一区| 日韩视频二区| 香蕉久久a毛片| 国产一区二区三区免费观看| 欧美资源在线观看| 欧美18av| 在线视频精品一区| 国产精品日韩| 久久国产加勒比精品无码| 免费成人av在线看| 亚洲靠逼com| 国产精品老牛| 久久先锋资源| 99视频一区二区| 久久久久久久久蜜桃| 在线欧美三区| 欧美视频免费| 久久久综合网站| 亚洲精一区二区三区| 午夜精品区一区二区三| 国产亚洲欧美一区二区| 久久久天天操| 一本色道久久综合亚洲91| 久久精品女人天堂| 亚洲日本aⅴ片在线观看香蕉| 欧美视频在线观看 亚洲欧| 欧美在线观看一二区| 亚洲电影在线播放| 亚洲性xxxx| 亚洲观看高清完整版在线观看| 欧美日韩国产精品自在自线| 亚洲男人影院| 亚洲风情在线资源站| 亚洲欧美另类久久久精品2019| 国内一区二区三区在线视频| 欧美精品亚洲二区| 欧美亚洲网站| 亚洲人精品午夜在线观看| 欧美中文字幕不卡| 亚洲裸体视频| 国内精品写真在线观看| 欧美日韩在线播放一区| 久久久999精品| 正在播放日韩| 亚洲国产成人久久综合一区| 久久久国产视频91| 亚洲综合精品| 99国产精品久久| 狠狠色噜噜狠狠色综合久| 欧美日韩一区二| 美日韩精品视频| 欧美一区在线直播| 亚洲网站在线| 亚洲精品影视在线观看| 欧美大片第1页| 久久久久久日产精品| 亚洲欧美伊人| 国产欧美一区二区精品性| 免费在线亚洲欧美| 欧美在线视频不卡| 亚洲欧美成人一区二区三区| 亚洲激情在线观看视频免费| 美女精品在线观看| 久久精品亚洲一区二区| 午夜精品久久久久久99热| 亚洲美女视频在线免费观看| 在线成人黄色| 国外成人在线| 激情亚洲成人| 国产一区在线免费观看| 国产三级欧美三级日产三级99| 国产精品日韩在线一区| 国产精品美女久久久免费| 国产精品久久网| 国产精品欧美久久| 国产精品美女午夜av| 欧美午夜视频一区二区| 欧美日韩久久| 欧美午夜精品理论片a级按摩| 欧美精品一区二区蜜臀亚洲| 欧美freesex交免费视频| 免费国产一区二区| 欧美激情按摩在线| 欧美伦理一区二区| 欧美日韩性生活视频| 欧美日韩国产一级| 欧美午夜电影在线观看| 欧美色中文字幕| 国产精品男gay被猛男狂揉视频| 欧美三级视频| 国产精品日韩欧美| 国产视频丨精品|在线观看| 国产亚洲精品久久飘花| 狠狠色丁香婷综合久久| 91久久午夜| 亚洲影院高清在线| 久久久国产一区二区| 久热爱精品视频线路一| 欧美激情第二页| 99精品视频免费全部在线| 亚洲一区二区日本| 久久久激情视频|