.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cycling through all text (interop)

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
364 Views, 2 Replies

Cycling through all text (interop)

Hi,
I am using C# an interop. I need to cycle through all text in an autoCAD 2D drawing, and search for a certain string.
How do i do this?
I imagined just creating a selection, and doing a foreach AcadText in selection.
This, however, gives me a cast exception.
Can i narrow my selection down to just selecting text?
If so, how do i do that?
2 REPLIES 2
Message 2 of 3
norman.yuan
in reply to: Anonymous

This NG is primaryly for .NET API. So even you use C#, COM interop questions may more likely get answered in VBA NG.

That said, you can just open AutoCAD VBA IDE, in Objet Browser, find AcadSelectionSet.Select() method, and click "?" button on the Object Browser to read how to use filter in the AcadSelectionSet.Select() method to only select entities of your choice in the VBA/COM API document. The sample code there is simple and straightforward.

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 3
Anonymous
in reply to: Anonymous

Thanks, that was my mistake 🙂

I actually did solve it last night though. Apparently there is both a MText and a Text, and they cannot be cast to eachother.

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost