明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1139|回复: 0

Translating tooltips in both AutoCAD and Revit using .NET

[复制链接]
发表于 2011-7-27 22:21 | 显示全部楼层 |阅读模式
作者:kean
原文地址:http://through-the-interface.typepad.com/through_the_interface/2011/07/translating-tooltips-in-both-autocad-and-revit-using-net.html

A quick update, today. Last week Jeremy posted a migrated version of the TransTips plug-in for AutoCAD, this time working inside Revit. Thanks to the shared use of AdWindows.dll in both products, this was actually really easy.
After this initial version, it made sense to refactor the code to have a core, shared file (not necessarily a separate DLL component – sharing source can give many benefits for smaller projects, such as this) used to build plugin DLLs for both AutoCAD and Revit.
Here’s the result: a single solution which will build TransTips DLLs for AutoCAD and Revit (including built versions of the DLLs). I won’t go into the specific details, here, although I did do as promised with regards to checking for network availability: if the app doesn’t manage to contact the Bing Translate service, it continues to work in offline mode, picking up translations from local XML files, where available. It’s also possible to specify this mode by default (with a very minor code change).
Otherwise the code itself should be reasonably straightforward. I used the “Add Existing Item –> Add Link” capability in VS 2010 to maintain a common file across both projects in the solution, which was new to me, and gave me exactly the project structure I was after.
In the next post in this series: support for Inventor (that one’s for you, Alex ;-) and additional work to share a common, WPF-based language selection UI across all the projects. At some point, beyond, I’ll also look at an editing capability for the XML data (also shared), and perhaps even some true componentization. We’ll see about that, though – in many ways I quite like the current approach of building a single DLL per-product.
"觉得好,就打赏"
还没有人打赏,支持一下

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-3-28 21:40 , Processed in 0.190853 second(s), 31 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表