0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Autodesk Inventor API Hacking (AddInのpath)

Posted at

0. はじめに

Freeradicalの中の人、yamarahです。
AddIn.dllと同じdirectoryに、設定ファイル.xmlを置きたい場面があると思います。このために、自分のAddIn.dllの場所を知る方法を調べました。

1. 結論

API 2024以前 2025以降
System.Reflection.Assembly.GetExecutingAssembly().Location AddIn.dll自体のpath ←に同じ
System.AppDomain.CurrentDomain.BaseDirectory Inventor.exeのdirectory 空文字列
System.AppContext.BaseDirectory Inventor.exeのdirectory 空文字列

GetExecutingAssembly().LocationGetDirectoryName()するのが良さそうです。
また、今回のお題とは関係ありませんが、Inventor.exeのdirectoryを得るのにBaseDirectoryを使っていた場合は、2025以降で挙動が変わっているので注意してください。

99. 親の記事に戻る

Autodesk Inventor API Hacking (概略)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?