Converting the CAD annotation layer to the reference information of the SDE annotation Features space (implementation of arcengine and C ++)

Source: Internet
Author: User

In my previous blog post, I talked about the conversion of notes, but the conversion does not contain space reference information. Therefore, I wrote another article to record the conversion of Space reference information.

First, it is the key to obtain reference information in the DWG file.CodeAs follows:

 Iworkspaceptr ipwork;
Iworkspacefactoryptr ipwfactory (clsid_cadworkspacefactory );
Hresult result = Ipwfactory -> Openfromfile (ccombstr (PATH ),
Null, & Ipwork );
Ifeatureworkspaceptr ipfwork = Ipwork;

Ifeaturedatasetptr ipdataset;
Result = Ipfwork -> Openfeaturedataset (ccombstr (filename ), & Ipdataset );

Ifeatureclasscontainerptr ipfcontainer = Ipdataset;

Iarrayptr arrlayer (clsid_array );
Long Lclasscount = 0 ;
Ipfcontainer -> Get_classcount ( & Lclasscount );

For ( Long I = 0 ; I < Lclasscount; I ++ )
{
Ifeatureclassptr ipfclass;
Result = Ipfcontainer -> Get_class (I, & Ipfclass );

Esrifeaturetype;
Ipfclass -> Get_featuretype ( & Type );
// Determine whether it is a note Layer
If (Esriftcoverageannotation ! = Type)
Continue ;

Igeodatasetptr ipgeodataset (ipfclass );
Ispatialreferenceptr ipsparef;
Ipgeodataset -> Get_spatialreference ( & Ipsparef );
}

Next, set the retrieved space reference information to annotation features in SDE. You can set it through interfaces such as ifeaturelayer and ilayer. Because it is relatively simple, the Code is not pasted out. If you have other good solutions, please leave a message.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.