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

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 夢在天涯 閱讀(2839) 評論(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

搜索

  •  

積分與排名

  • 積分 - 1815010
  • 排名 - 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>
              欧美专区日韩视频| 欧美一区二区观看视频| 9色精品在线| 狠色狠色综合久久| 国产亚洲aⅴaaaaaa毛片| 国产精品入口66mio| 国产精品久久久久久一区二区三区| 一区二区在线视频播放| 99精品国产99久久久久久福利| 一区二区三区视频在线播放| 制服丝袜激情欧洲亚洲| 国模吧视频一区| 尤物yw午夜国产精品视频明星| 在线国产亚洲欧美| 亚洲精品欧美一区二区三区| 一本大道久久a久久精二百| 亚洲视频图片小说| 久久精品毛片| 欧美成人午夜影院| 亚洲精品国产拍免费91在线| 欧美第一黄网免费网站| 99re8这里有精品热视频免费| 亚洲欧美日韩一区二区三区在线| 欧美自拍偷拍午夜视频| 欧美片网站免费| 国产午夜精品久久久| 亚洲国产一区在线| 亚洲欧美日韩久久精品 | 一区二区三区精品视频在线观看| 亚洲四色影视在线观看| 久久久水蜜桃av免费网站| 欧美日本亚洲视频| 激情六月综合| 亚洲中字在线| 老司机免费视频久久| 亚洲视频精品在线| 免费观看日韩| 国产真实乱偷精品视频免| 日韩视频一区二区三区在线播放| 欧美一区高清| 99热精品在线观看| 卡通动漫国产精品| 国产精品免费观看在线| 亚洲精品在线观看免费| 久久午夜视频| 午夜精品久久久久久久蜜桃app | 一区二区三区高清在线| 久久偷看各类wc女厕嘘嘘偷窃| 欧美午夜电影网| 亚洲精品免费网站| 欧美福利小视频| 久久久亚洲人| 国内精品久久久久影院薰衣草| 亚洲一区影音先锋| 日韩视频―中文字幕| 欧美激情一二区| 亚洲精品美女在线观看播放| 欧美国产高潮xxxx1819| 亚洲欧美激情一区二区| 日韩一级黄色av| 欧美成人免费全部| 久久久久久久综合狠狠综合| 国产精品久久久久久亚洲毛片| 亚洲视频网站在线观看| 亚洲精品乱码久久久久久久久| 免费观看亚洲视频大全| 亚洲高清不卡av| 亚洲电影一级黄| 欧美紧缚bdsm在线视频| 一区二区三区欧美亚洲| 亚洲欧洲视频| 欧美日韩一卡二卡| 亚洲一区二区精品在线| 亚洲一级在线观看| 国产午夜精品在线观看| 久久综合久久综合久久综合| 亚洲午夜日本在线观看| 欧美日韩在线播放一区二区| 一区二区三区鲁丝不卡| 国产精品成人aaaaa网站| 一本色道久久88亚洲综合88| 欧美在线精品一区| 亚洲欧美一区二区三区在线| 亚洲欧美日韩精品久久亚洲区| 国产麻豆视频精品| 在线视频你懂得一区二区三区| 亚洲毛片播放| 依依成人综合视频| 久久精品72免费观看| 亚洲风情亚aⅴ在线发布| 久久一二三区| 亚洲最新合集| 久久久久久网站| 亚洲视频在线观看三级| 另类av一区二区| 亚洲综合视频一区| 一区二区精品| 午夜在线精品偷拍| 久久精品99国产精品| 亚洲高清久久| 99精品欧美一区| 韩日午夜在线资源一区二区| 亚洲电影免费观看高清完整版在线观看| 亚洲欧美日韩精品在线| 免费成人高清| 欧美日韩www| 久久久久国产精品一区三寸| 美女亚洲精品| 欧美一区二区三区的| 蜜月aⅴ免费一区二区三区| 中日韩高清电影网| 久久精品国产亚洲5555| 一本在线高清不卡dvd| 欧美一级成年大片在线观看| 99国内精品久久| 久久久青草婷婷精品综合日韩 | 欧美久久一区| 久久久99免费视频| 欧美特黄一区| 亚洲国产精品一区二区三区 | 亚洲片在线资源| 午夜久久tv| 宅男精品视频| 欧美成人精品高清在线播放| 久久久www成人免费无遮挡大片 | 免费试看一区| 久久精品视频在线免费观看| 欧美日韩一区二区在线观看| 男人插女人欧美| 国产一区日韩二区欧美三区| 亚洲永久免费观看| 欧美精品一区二区三| 免费日韩成人| 久久综合久久久久88| 久久一区二区精品| 国产日韩欧美在线| 亚洲欧美日韩综合aⅴ视频| 中文精品一区二区三区| 久久另类ts人妖一区二区| 久久精品最新地址| 国产自产v一区二区三区c| 一本久久a久久精品亚洲| 亚洲国产清纯| 久久欧美肥婆一二区| 欧美成人免费网站| 亚洲国产欧美在线人成| 欧美成人高清| 最新亚洲电影| 亚洲午夜视频在线观看| 欧美精品亚洲二区| 日韩视频精品在线| 99热精品在线| 欧美性色视频在线| 亚洲午夜国产成人av电影男同| 亚洲综合欧美日韩| 国产精品影院在线观看| 欧美影院在线播放| 久久综合久久久| 99re6热在线精品视频播放速度| 欧美精品日韩一区| 亚洲一区自拍| 另类av导航| 一区二区三区欧美成人| 欧美香蕉视频| 欧美专区第一页| 久久精品视频在线| 亚洲人成在线观看一区二区| 亚洲欧美中文字幕| 乱中年女人伦av一区二区| 在线视频日韩精品| 亚洲国产精品va在线观看黑人| 亚洲午夜精品一区二区| 欧美在线一二三四区| 一区二区三区色| 午夜精品久久久久影视| 久久久久看片| 日韩一级在线观看| 久久久蜜桃精品| 老司机免费视频一区二区三区| 另类av一区二区| 国产精品综合| 国产日韩欧美成人| 在线国产日韩| 免费不卡在线观看av| 欧美精品18| 伊人久久婷婷| 国产一区二区三区最好精华液| 亚洲精品美女在线观看播放| 国产在线视频欧美一区二区三区| 亚洲美女黄网| 欧美a级理论片| 亚洲成色999久久网站| 久久久精品国产99久久精品芒果| 99热这里只有成人精品国产| 欧美日韩国产一级| 亚洲国产综合在线看不卡| 久久精品国产免费观看| 日韩亚洲视频在线| 欧美bbbxxxxx| 黄色精品免费|