Отладка плагина в Autocad 2010
Чтобы отправить ответ, вы должны войти или зарегистрироваться
Сообщения 9
#1 Тема от Namolem 8 апреля 2013г. 14:29:28 (изменено: Валерий Осипов, 8 апреля 2013г. 14:29:52)
- Namolem
- Участник
- На форуме с 1 июля 2012г.
- Сообщений: 94
- Спасибо: 1
Тема: Отладка плагина в Autocad 2010
Добрый день. В новой версии автокада не получается отладить свой плагин.
Порядок действий:
1) Пишу плагин
2) Компилирую
3) Запускаю автокад
4) Загружаю плагин через netload
5) Ставлю брякпоинт в Visual Studio 2012
6) Tools -> Attach to process -> acad.exe
7) Выполняю в автокаде команду, на которой стоит точка остановки.
В результате полностью зависает окно автокада, студия тоже «висит», пока не прибью процесс acad.exe.
Версия среды плагина: 3.5
Содержимое acad.exe.config:
#2 Ответ от hwd 8 апреля 2013г. 20:29:14
- hwd
- Активный участник
- На форуме с 18 сентября 2009г.
- Сообщений: 397
- Спасибо: 13
Re: Отладка плагина в Autocad 2010
1. Версию AutoCAD завтра указывать будешь?
2. Подключаешься из IDE к уже запущенному процессу acad, или посредством соответствующих настроке на вкладке Debug, процесс acad запускает сама IDE?
#3 Ответ от shss 9 апреля 2013г. 07:21:11
- shss
- Активный участник
- Откуда: Омск
- На форуме с 4 марта 2009г.
- Сообщений: 179
- Спасибо: 1
Re: Отладка плагина в Autocad 2010
#4 Ответ от Namolem 9 апреля 2013г. 09:59:08
- Namolem
- Участник
- На форуме с 1 июля 2012г.
- Сообщений: 94
- Спасибо: 1
Re: Отладка плагина в Autocad 2010
Сергей, спасибо, помог третий способ из ссылки. Добавил к решению существующий проект acad.exe, в настройках поставил attach=false, запускаю через него.
Неудачные попытки:
1) Установил Start application в Debug для dll-ки, при старте автокада вылетает ошибка о том, что нельзя загрузить ресурс MyAutocadBaloon (какой-то стандартный для автокада, в проекте у меня такого нет)
2) Поигрался с версиями фреймворка в настройках плагина и автокада, вылетали ошибки Unsupported version of Windows Presentation Foundation и сборка создана в более поздней среде исполнения
3) При попытке Attach to process зависал автокад
Hwnd, версия автокада 2010
#5 Ответ от hwd 9 апреля 2013г. 10:48:39
- hwd
- Активный участник
- На форуме с 18 сентября 2009г.
- Сообщений: 397
- Спасибо: 13
Re: Отладка плагина в Autocad 2010
Не нужно путать мой логин с дескриптором Windows.
Сергей , спасибо, помог третий способ из ссылки.
.
Неудачные попытки:
.
Так проблема решена, или нет?
#6 Ответ от Namolem 9 апреля 2013г. 11:36:27
- Namolem
- Участник
- На форуме с 1 июля 2012г.
- Сообщений: 94
- Спасибо: 1
Re: Отладка плагина в Autocad 2010
> Не
нужно путать мой логин с дескриптором Windows.
Извиняюсь, невнимательность.
>Так проблема решена, или нет?
Можно сказать, да, хотя с Attach to process было бы удобнее.
What is Windows Presentation Foundation
Welcome to the Desktop Guide for Windows Presentation Foundation (WPF), a UI framework that creates desktop client applications for Windows. The WPF development platform supports a broad set of application development features, including an application model, controls, graphics, and data binding. WPF uses Extensible Application Markup Language (XAML) to provide a declarative model for application programming.
The Desktop Guide documentation for .NET 5 (and .NET Core) and is under construction.
There are two implementations of WPF:
The open-source implementation hosted on GitHub. This version runs on .NET Core 3.0. The WPF Visual Designer for XAML requires, at a minimum, Visual Studio 2019 version 16.3.
The .NET Framework implementation that’s supported by Visual Studio 2019 and Visual Studio 2017.
This Desktop Guide is written for .NET Core 3.0 and WPF. For more information about the existing documentation for WPF with the .NET Framework, see Framework Windows Presentation Foundation.
XAML is a declarative XML-based language that WPF uses for things such as defining resources or UI elements. Elements defined in XAML represent the instantiation of objects from an assembly. XAML is unlike most other markup languages, which are interpreted at runtime without a direct tie to a backing type system.
The following example shows how you would create a button as part of a UI. This example is intended to give you an idea of how XAML represents an object, where Button is the type and Content is a property.
XAML extensions
XAML provides syntax for markup extensions. Markup extensions can be used to provide values for properties in attribute form, property-element form, or both.
For example, the previous XAML code defined a button with the visible content set to the literal string «Click Me!» , but the content can be instead set by a supported markup extension. A markup extension is defined with opening and closing curly braces < >. The type of markup extension is then identified by the string token immediately following the opening curly brace.
WPF provides different markup extensions for XAML such as
Property system
WPF provides a set of services that can be used to extend the functionality of a type’s property. Collectively, these services are referred to as the WPF property system. A property that is backed by the WPF property system is known as a dependency property.
Dependency properties extend property functionality by providing the DependencyProperty type that backs a property. The dependency property type is an alternative implementation of the standard pattern of backing the property with a private field.
Dependency property
In WPF, dependency properties are typically exposed as standard .NET properties. At a basic level, you could interact with these properties directly and never know that they’re implemented as a dependency property.
The purpose of dependency properties is to provide a way to compute the value of a property based on the value of other inputs. These other inputs might include system properties such as themes and user preferences, or just-in-time property from data binding and animations.
A dependency property can be implemented to provide validation, default values, and callbacks that monitor changes to other properties. Derived classes can also change some specific characteristics of an existing property by overriding dependency property metadata, rather than creating a new property or overriding an existing property.
Dependency object
Another type that is key to the WPF property system is the DependencyObject. This type defines the base class that can register and own a dependency property. The GetValue and SetValue methods provide the backing implementation of the dependency property for the dependency object instance.
The following example shows a dependency object that defines a single dependency property identifier named ValueProperty . The dependency property is created with the Value .NET property.
The dependency property is defined as a static member of a dependency object type, such as TextField in example above. The dependency property must be registered with the dependency object.
The Value property in the example above wraps the dependency property, providing the standard .NET property pattern you’re probably used to.
Events
WPF provides an eventing system that is layered on top of the .NET common language runtime (CLR) events you’re familiar with. These WPF events are called routed events.
A routed event is a CLR event that is backed by an instance of the RoutedEvent class and registered with the WPF event system. The RoutedEvent instance obtained from event registration is typically retained as a public static readonly field member of the class that registers, and thus owns the routed event. The connection to the identically named CLR event (which is sometimes termed the wrapper event) is accomplished by overriding the add and remove implementations for the CLR event. The routed event backing and connection mechanism is conceptually similar to how a dependency property is a CLR property that is backed by the DependencyProperty class and registered with the WPF property system.
The main advantage of the routed event system is that events are bubbled up the control element tree looking for a handler. For example, because WPF has a rich content model, you set an image control as the content of a button control. When the mouse is clicked on the image control, you would expect it to consume the mouse events, and thus break the hit-tests that cause a button to invoke the Click event. In a traditional CLR eventing model, you would work around this limitation by attaching the same handler to both the image and the button. But with the routed event system, the mouse events invoked on the image control (such as selecting it) bubble up to the parent button control.
Data binding
WPF data binding provides a simple and consistent way for applications to present and interact with data. Elements can be bound to data from different types of data sources in the form of common language runtime (CLR) objects and XML. WPF also provides a mechanism for the transfer of data through drag-and-drop operations.
Data binding is the process that establishes a connection between the application UI and business logic. If the binding has the correct settings and the data provides the proper notifications, then, when the data changes its value, the elements that bound to the data reflect changes automatically. Data binding can also mean that if an outer representation of the data in an element changes, then the underlying data is automatically updated to reflect the change. For example, if the user edits the value in a TextBox element, the underlying data value is automatically updated to reflect that change.
Data binding can be configured in XAML through the
UI components
WPF provides many of the common UI components that are used in almost every Windows application, such as Button , Label , TextBox , Menu , and ListBox . Historically, these objects have been referred to as controls. While the WPF SDK continues to use the term control to loosely mean any class that represents a visible object in an application, it’s important to note that a class doesn’t need to inherit from the Control class to have a visible presence. Classes that inherit from the Control class contain a ControlTemplate , which allows the consumer of a control to radically change the control’s appearance without having to create a new subclass.
Styles and templates
WPF styling and templating refer to a suite of features (styles, templates, triggers, and storyboards) that allow an application, document, or UI designer to create visually compelling applications and to standardize on a particular look for their product.
Another feature of the WPF styling model is the separation of presentation and logic, which means designers can work on the appearance of an application with XAML while developers work on the programming logic elsewhere.
In addition, it’s important to understand resources, which are what enable styles and templates to be reused.
For more information, see Styles and templates.
Resources
WPF resources are objects that can be reused in different places in your application. Examples of resources include styles, templates, and color brushes. Resources can be both defined and referenced in code and in XAML format.
Every framework-level element (FrameworkElement or FrameworkContentElement) has a Resources property (which is a ResourceDictionary type) that contains defined resources. Since all elements inherit from a framework-level element, all elements can define resources. It’s most common, however, to define resources on a root element of a XAML document.
AutoCAD
Autodesk Support
Report this article?
Starting August 31, 2019, Autodesk will start enforcing its technical support lifecycle policy for all current versions of Autodesk software and previous versions (typically three versions back), listed on the subscription and maintenance plan eligibility lists.
What does this mean for my right to use Autodesk software?
You can continue to use any previous version in your possession, as long as it doesn’t violate the product’s terms of use. See Product Support Lifecycle for more information.
Why did Autodesk choose to make this change in their product activation process now?
The majority of our activation code generators are built on aging technology, some of which are no longer supported by the vendors that built them. Aligning product activation practices allows us to retire many of the unsupported generators which reduces risk and ensures that we provide the help you need.
What is the best way for me to get a current version of my software?
We have many purchasing options and often runs promotions. Find current subscriptions and promotions on www.autodesk.com.
Is it possible to request an activation code and save it for future use?
It is possible, but only within strictly controlled parameters where the configuration does not change from the time the code is generated. We cannot guarantee that previously-generated codes will work as intended. We won’t offer product activation or installation support for products that are not on the eligible previous version list for subscriptions and maintenance plans.
If my current network licensing file includes products which are v2010 or earlier, will I be able to get an activation code?
No. Product version is validated during the activation process. Versions 2010 or earlier cannot be activated.
What about products that didn’t use the year as a version (for example, R10)?
All products using a non-year version scheme are included in the v2010 or earlier set of releases and can no longer be activated after August 31, 2019.
Will I be able to access my drawings and files from previous versions if I am unable to activate that previous version?
Autodesk software is backward compatible, so, you can access older files if you upgrade to the current version.
Can I activate a perpetual product version 2011 and later?
Yes. Product activation for versions 2011 and later is available.
If my maintenance plan ends, what version will I be able to activate?
The Terms of the maintenance plan stipulate that upon termination you can only use the last activated version and must uninstall any other versions.
For example, if AutoCAD 2020 was the current version when your plan terminated, but you last activated AutoCAD 2018, you can only use AutoCAD 2018. If you request an activation code for AutoCAD 2018, your version of record becomes AutoCAD 2018, and we’ll provide you with an activation code. You can continue to get technical support for AutoCAD 2018 until it is no longer listed on the maintenance plan eligible previous version list.
Will I still be able to get boxed software and downloads?
Boxed software and download requests follow existing service offerings for products listed on the eligible previous version list for subscriptions and maintenance plans. If you have an active maintenance plan, you can request physical media for the most current product version and eligible previous versions. Some products or versions may no longer be supported. For subscription licenses, media kits can be purchased as needed.
Does the Previous Version Support Lifecycle policy apply to NFR and PED?
Yes. This policy applies to all product types, including NFR and PED.