Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load ASM from SharedComponents folder #3117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.33
0.6.34
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.6.34
* Load ASM from SharedComponents folder

## 0.6.33
* Update Node Migrations and one test after obsolete node removal

Expand Down
6 changes: 1 addition & 5 deletions src/DynamoRevit/DynamoRevit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -575,11 +575,7 @@ private static RevitDynamoModel InitializeCoreModel(DynamoRevitCommandData comma

internal static Version PreloadAsmFromRevit()
{
var asmLocation = AppDomain.CurrentDomain.BaseDirectory;
// TODO: remove this when above will work
if (string.IsNullOrEmpty(asmLocation))
asmLocation = Path.GetDirectoryName(Environment.ProcessPath);

string asmLocation = DynamoRevitApp.ASMPath;
Version libGVersion = findRevitASMVersion(asmLocation);
var dynCorePath = DynamoRevitApp.DynamoCorePath;
// Get the corresponding libG preloader location for the target ASM loading version.
Expand Down
8 changes: 8 additions & 0 deletions src/DynamoRevit/DynamoRevitApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ private static string GetDynamoRoot(string dynamoRevitRoot)
private static readonly Queue<Action> idleActionQueue = new Queue<Action>(10);
private static EventHandlerProxy proxy;
private AddInCommandBinding dynamoCommand;
internal static string ASMPath;

private Result loadDependentComponents()
{
Expand Down Expand Up @@ -136,6 +137,13 @@ public Result OnStartup(UIControlledApplication application)
UIControlledApplication = application;
ControlledApplication = application.ControlledApplication;

// TO_DO: get the asm path from API

var rvtExePath = AppDomain.CurrentDomain.BaseDirectory;
if (string.IsNullOrEmpty(rvtExePath))
rvtExePath = Path.GetDirectoryName(Environment.ProcessPath);
ASMPath = Path.Combine(rvtExePath, "SharedComponents", "1.0.0");

SubscribeAssemblyEvents();
SubscribeApplicationEvents();

Expand Down