AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Autocad Map VBA connection to shapefile?

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
capuano3d
774 Views, 3 Replies

Autocad Map VBA connection to shapefile?

capuano3d
Enthusiast
Enthusiast

Hi there, is there a way to achieve the above, via vba programming?

 

If so, could you please provide an example?

 

Thanks in advance.

0 Likes

Autocad Map VBA connection to shapefile?

Hi there, is there a way to achieve the above, via vba programming?

 

If so, could you please provide an example?

 

Thanks in advance.

3 REPLIES 3
Message 2 of 4
norman.yuan
in reply to: capuano3d

norman.yuan
Mentor
Mentor
Accepted solution

When you say "...connection to shape..." do you mean to connect shape file as FDO data source, as you do manually through AutoCAD Map's "Task Pane -> Display Manager -> Data"? If so, no, there is no COM/VBA support to connect AutoCAD Map to shape (or other FDO source, for taht matter).

 

If you want to get shape data (or other FDO source) into AutoCAD Map as map layer(s) programmatically, you need to learn AutoCAD Map geospatial platform APIs (.NET API).

Norman Yuan

Drive CAD With Code

EESignature

0 Likes

When you say "...connection to shape..." do you mean to connect shape file as FDO data source, as you do manually through AutoCAD Map's "Task Pane -> Display Manager -> Data"? If so, no, there is no COM/VBA support to connect AutoCAD Map to shape (or other FDO source, for taht matter).

 

If you want to get shape data (or other FDO source) into AutoCAD Map as map layer(s) programmatically, you need to learn AutoCAD Map geospatial platform APIs (.NET API).

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 4
capuano3d
in reply to: norman.yuan

capuano3d
Enthusiast
Enthusiast

Thanks for your answer, yes, that was I meant.

 

I'm not able to have visual studio installed in my machine, but what I would like at the end may be fairly simple, I just wanted a way, say a ribbon button, to quickly bring the data from some recurring sources we have.

 

I thought about even to try the 'sendcommand' vba function, but database connection doesn't seem to have a transparent command version.

 

Well, could you after all point me out for some solution?

 

Thanks again,

 

Alan

0 Likes

Thanks for your answer, yes, that was I meant.

 

I'm not able to have visual studio installed in my machine, but what I would like at the end may be fairly simple, I just wanted a way, say a ribbon button, to quickly bring the data from some recurring sources we have.

 

I thought about even to try the 'sendcommand' vba function, but database connection doesn't seem to have a transparent command version.

 

Well, could you after all point me out for some solution?

 

Thanks again,

 

Alan

Message 4 of 4
norman.yuan
in reply to: capuano3d

norman.yuan
Mentor
Mentor

Considering the quite complicated, multiple steps of using Display Manager to connect FDO data source, I doubt it is possible to either create an AutoCAD script macro, or using VBA's "SendCommand" to complete the whole manual process. At least I never tried, or thought to try. 

 

Also, as my previous reply said, there is no VBA support for AutoCAD Map FDO connection. While manaully connect to shape file can be as simple as dragging the shape files into AutoCAD Map, after the draggng, user liely needs to reconfigure the map layers as reqiured. This only way to programmatically connect to shape data as map layers is to use geospatial platform API, which the code can control the connecting process precisely as you want: where the source shapes are, how the map layer is defined, which geometries in the shape are to be shown in the map drawing...

 

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes

Considering the quite complicated, multiple steps of using Display Manager to connect FDO data source, I doubt it is possible to either create an AutoCAD script macro, or using VBA's "SendCommand" to complete the whole manual process. At least I never tried, or thought to try. 

 

Also, as my previous reply said, there is no VBA support for AutoCAD Map FDO connection. While manaully connect to shape file can be as simple as dragging the shape files into AutoCAD Map, after the draggng, user liely needs to reconfigure the map layers as reqiured. This only way to programmatically connect to shape data as map layers is to use geospatial platform API, which the code can control the connecting process precisely as you want: where the source shapes are, how the map layer is defined, which geometries in the shape are to be shown in the map drawing...

 

 

Norman Yuan

Drive CAD With Code

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report