Problem with version

Problem with version

MarkJamesRogolino
Advocate Advocate
785 Views
11 Replies
Message 1 of 12

Problem with version

MarkJamesRogolino
Advocate
Advocate

Hello everyone of Tribe. Your support was always helpful with me.

I made a small Addin of AutoCAD.

It works well in AutoCAD 2020,
But it does not work in AutoCAD 2021.
So I did netload command manaually, but any command does not work also.
How can I solve it.
Hope for your kind help. Thank you.

 
0 Likes
Accepted solutions (1)
786 Views
11 Replies
Replies (11)
Message 2 of 12

ActivistInvestor
Mentor
Mentor

Your question can't be answered because the answer depends on what problem(s) exist in your code, which you haven't disclosed.

0 Likes
Message 3 of 12

MarkJamesRogolino
Advocate
Advocate

Thank you for your reply. Every commands works well in acad 2020 but any command does not work in acad 2021. I think it is not releated with code. My small opinion.

0 Likes
Message 4 of 12

ActivistInvestor
Mentor
Mentor

@MarkJamesRogolino wrote:

Thank you for your reply. Every commands works well in acad 2020 but any command does not work in acad 2021. I think it is not releated with code. My small opinion.


It is definitely related to code.

 

 

Message 5 of 12

JamesMaeding
Advisor
Advisor
Accepted solution

And code is significant. The passage of time will always affect code, and its a subject we should all want to discuss. Code is text put together in a file that computers read, and is how AI works. AI is not a subject we should ignore, we should discuss it, and care about it. I am very sorry about your code, deeply sorry.

LOL, I could write that all day. Show us some code buddy, but aslo mention if your new project references the acad 2021 .net assemblies, with copylocal property set to false.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 6 of 12

MarkJamesRogolino
Advocate
Advocate

You are helping me, Dont be sorry about code.

I share my simple command. But even it does not work.

All the references copylocal properties are false.

But I  added references from 2020 version libraries(acdbmgd, accoremgd, acmgd).

Is this is just the main cause of problem?

0 Likes
Message 7 of 12

ActivistInvestor
Mentor
Mentor

Looks like you're on your own now, good luck finding the problem.

0 Likes
Message 8 of 12

kerry_w_brown
Advisor
Advisor

@MarkJamesRogolino wrote:

>>>

But I  added references from 2020 version libraries(acdbmgd, accoremgd, acmgd).

Is this is just the main cause of problem?


Change references to 2021 libraries and recompile . . . 

That would be a good place to start


// Called Kerry or kdub in my other life.

Everything will work just as you expect it to, unless your expectations are incorrect. ~ kdub
Sometimes the question is more important than the answer. ~ kdub

NZST UTC+12 : class keyThumper<T> : Lazy<T>;      another  Swamper
0 Likes
Message 9 of 12

MarkJamesRogolino
Advocate
Advocate

Thank you for your kind teaching me.

This is my simple command.

[CommandMethod("viewchk")]
public void ViewCheck()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;
using (var view = ed.GetCurrentView())
{
ed.WriteMessage($"\nCurrent View: {GetViewName(view.ViewDirection)}");
}
}

But even it does not work.

And I installed acad 2021 LT version and recompile my solution with acad 2021 reference.

But there is no netload command in LT version. Am I right?

I am not sure about this.

0 Likes
Message 10 of 12

kerry_w_brown
Advisor
Advisor

https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/Is-it-possible-to-....

 

Autodesk apps, plugins, add-ons, or in API-tools from the App store or other sources cannot be installed on AutoCAD LT. They can only be installed on AutoCAD including specialized toolsets.

 


// Called Kerry or kdub in my other life.

Everything will work just as you expect it to, unless your expectations are incorrect. ~ kdub
Sometimes the question is more important than the answer. ~ kdub

NZST UTC+12 : class keyThumper<T> : Lazy<T>;      another  Swamper
Message 11 of 12

JamesMaeding
Advisor
Advisor

Oh, LT, LOL.

Minor detail there.

I guess now that Lips supposedly works on LT, people expect .net also.

I told Autodesk that would be a problem but my dog does not listen to me either so....


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 12 of 12

kerry_w_brown
Advisor
Advisor

@MarkJamesRogolino 

While reviewing your post I decided to make assumptions about the codes purpose ;

Here's my guess, expressed by revising method and variable names and providing best-guess of the missing functionality.

These are things you should have provided in your first post, along with the comment about attempting to use AutoCAD LT 2021.

[CommandMethod("viewchk")]
public void ViewDirectionCheck() {
   Editor ed = CadApp.DocumentManager.MdiActiveDocument.Editor;
   using (var viewRecord = ed.GetCurrentView()) {
      ed.WriteMessage($"\nCurrent View Direction : {GetViewDirectionAxis(viewRecord.ViewDirection)}");
   }
}

private string GetViewDirectionAxis(Vector3d viewDirection) {
   if (viewDirection == Vector3d.XAxis) return "X-Axis";
   if (viewDirection == Vector3d.YAxis) return "Y-Axis";
   if (viewDirection == Vector3d.ZAxis) return "Z-Axis";
   return "Unknown";
}

 

Best fortune,


// Called Kerry or kdub in my other life.

Everything will work just as you expect it to, unless your expectations are incorrect. ~ kdub
Sometimes the question is more important than the answer. ~ kdub

NZST UTC+12 : class keyThumper<T> : Lazy<T>;      another  Swamper
0 Likes