C#代码从autocad绘图中选择文本&在消息框中显示它 [英] C# code to select a text from an autocad drawing & show it on a message box
本文介绍了C#代码从autocad绘图中选择文本&在消息框中显示它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从autocad绘图中选择一个文本&我想在消息框上显示文本值
我尝试过:
I want to select a text from autocad drawing & i want to show that text value on message box
What I have tried:
SelectionFilter sf = new SelectionFilter(new TypedValue[] { new TypedValue(0, "TEXT") });
PromptSelectionOptions pso = new PromptSelectionOptions();
pso.MessageForAdding = "\nSelect the text";
pso.SingleOnly = true;
PromptSelectionResult psr1 = ed.GetSelection(pso, sf);
if (psr1.Status != PromptStatus.OK) return;
SelectionSet ss = psr1.Value;
ObjectId[] id = ss.GetObjectIds();
MessageBox.Show(id.ToString());
推荐答案
参见此处示例:使用.NET浏览AutoCAD文本和操作结果 - 通过界面 [ ^ ]
这里:提取文本的最快方式 [ ^ ]
See example here: Exploding AutoCAD text and manipulating the results using .NET - Through the Interface[^]
And here: Quickest way to extract text[^]
这篇关于C#代码从autocad绘图中选择文本&在消息框中显示它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文