In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to use AutoCAD hosting C# applications, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!
We use the class library template, so we have to add acdbmdg manually. Dll and acmgd.dll are two references. We will use the AutoCAD managed C # application wizard to create a .NET project, which automatically adds the above two references. Before starting this chapter, you must first install the ObjectARX wizard (\ utils\ ObjARXWiz\ ArxWizards.msi of the ObjectARX2006 package).
1) start Visual Studio .NET and select "File > New > Project" (File > New > Project). In the New Project dialog box, select the project type as Visual C # Project, and then select the AutoCAD Managed CS Project Application template. Type "Lab2" in the project name box, and then select the location where the project is stored. Click the OK button and the AutoCAD Managed CSharp Application Wizard dialog box will appear. Do not select the "Enable Unmanaged Debugging" item because we do not need to use unmanaged code. "Registered Developer Symbol" will use the value you entered when you installed the ObjectARX wizard. Click the finish button to create the project.
2) Let's take a look at the project generated by the wizard. In the solution browser, you will see that acdbmgd and acmgd have been referenced. In the Class.cs file, the "Autodesk.AutoCAD.Runtime" namespace has been imported, and the project uses the name "Registered Developer Symbol" to name the default public class. The wizard also adds a CommandMethod property and a function to the class, which are used in the AutoCAD command.
3) We use an instance object of the "Autodesk.AutoCAD.EditorInput.Editor" class to output text on the AutoCAD command line. In this chapter, we will use this class to prompt the user to select a point in the AutoCAD graph, and then display the x and Z values of the point selected by the user. As in the previous chapter, import the Autodesk.AutoCAD.ApplicationServices and Autodesk.AutoCAD.EditorInput namespaces.
4) change the value of the CommandMethod property generated by the wizard to something more meaningful, such as "selectPoint" (the name of the function can not be changed). The PromptPointOptions class is used to set prompt strings and other options that control prompts. An instance of this class is passed as a parameter to the Editor.GetPoint method. At the beginning of the function, instantiate the class and set the string parameter to "Select a point". Because the Editor.GetPoint method returns an instance object of the PromptPointResult class, we will instantiate it as well.
PromptPointOptions prPointOptions = new PromptPointOptions ("Select a point"); PromptPointResult prPointRes; above is all the content of the article "how to use AutoCAD to host C# applications". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.