Working with ImpEntity

Working with ImpEntity

Anonymous
Not applicable
1,812 Views
7 Replies
Message 1 of 8

Working with ImpEntity

Anonymous
Not applicable
How do I go about working with ImpEntity objects that are inserted via FDO?
I'd like to get some attribute information from them.

I'm using Map 2008 and .Net 2.0.

-Anthony
0 Likes
1,813 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
You need to use the FDO API, there are some samples in the toolkit that may
point you in the right direction.

--

Murph
The world is not FLAT so why is your GIS data?
http://map3d.wordpress.com

"Anthony" wrote in message
news:5672472@discussion.autodesk.com...
How do I go about working with ImpEntity objects that are inserted via FDO?
I'd like to get some attribute information from them.

I'm using Map 2008 and .Net 2.0.

-Anthony
0 Likes
Message 3 of 8

Anonymous
Not applicable
Please can you tell me what FDO API example helps with ImpEntity?? Or post some code in C# to use that class??
I was trying to do that and work with the data table using C# but I can't find a guide...

I would like to use the Data inside the datagrid invoked with the Table menu option or the _mapdatagrid command...
0 Likes
Message 4 of 8

Anonymous
Not applicable
Try this from Tony, he knows more than I do about it.

http://discussion.autodesk.com/thread.jspa?threadID=604438

--

Murph
The world is not FLAT so why is your GIS data?
http://map3d.wordpress.com
wrote in message news:5709166@discussion.autodesk.com...
Please can you tell me what FDO API example helps with ImpEntity?? Or post
some code in C# to use that class??
I was trying to do that and work with the data table using C# but I can't
find a guide...

I would like to use the Data inside the datagrid invoked with the Table menu
option or the _mapdatagrid command...
0 Likes
Message 5 of 8

Anonymous
Not applicable
Opps Just noticed you replied there also. I just tinker with code and not
an expert with C# or anything pass lisp/VBa but I think you need to use the
FDO provider to get the data out into a usable format.

--

Murph
The world is not FLAT so why is your GIS data?
http://map3d.wordpress.com
"James Murphy" wrote in message
news:5709320@discussion.autodesk.com...
Try this from Tony, he knows more than I do about it.

http://discussion.autodesk.com/thread.jspa?threadID=604438

--

Murph
The world is not FLAT so why is your GIS data?
http://map3d.wordpress.com
wrote in message news:5709166@discussion.autodesk.com...
Please can you tell me what FDO API example helps with ImpEntity?? Or post
some code in C# to use that class??
I was trying to do that and work with the data table using C# but I can't
find a guide...

I would like to use the Data inside the datagrid invoked with the Table menu
option or the _mapdatagrid command...
0 Likes
Message 6 of 8

Anonymous
Not applicable
At last!!! I found the way to use the ImpEntity!!!

If you use AutoCAD MAP 2008 and .NET 2.0 then you have to use this file to get the examples:

sdk.dev.net.gis could be the chm or the pdf, that is located inside the AutoCad folder and Help folder...

There I got the info, the best example is:

AcMapMap currentMap = AcMapMap.GetCurrentMap();
MgFeatureService fs =
AcMapServiceFactory.GetService(MgServiceType.FeatureService)
as MgFeatureService;

MgLayerCollection layers = currentMap.GetLayers();
MgLayerBase parcelsLayer = layers.GetItem("Parcels");
string fcName = parcelsLayer.GetFeatureClassName();

MgSelectionBase selection = currentMap.GetFeatureSelection();
string selectionFilter = selection.GenerateFilter(parcelsLayer,
fcName );

MgFeatureQueryOptions queryOpts = new MgFeatureQueryOptions();
queryOpts.SetFilter(selectionFilter);
MgFeatureReader featureReader;

MgResourceIdentifier fsId = new
MgResourceIdentifier(parcelsLayer.GetFeatureSourceId());
featureReader = fs.SelectFeatures(fsId, fcName, queryOpts);

With that you get the selected feature, and with a featureReader.ReadNext(); and a featureReader.GetString(#); you get the value from the property # (number of the property), you can explore the MgFeatureReader class to get more info...
0 Likes
Message 7 of 8

andy62
Contributor
Contributor
Hi FcoLomas
can you help me?
I don't find a GetFeatureSelection method of AcMapMap
is the code below correct?
MgSelectionBase selection = currentMap.GetFeatureSelection();
andrea
0 Likes
Message 8 of 8

Anonymous
Not applicable

Same issue MgSelectionBase selection = currentMap.GetFeatureSelection(); is not valid. Any luck with this? I assume the API changed yet again and the docuentation is not up to par.

0 Likes