Begginer issues ActiveUIdocument and StringBuilder Errors

Begginer issues ActiveUIdocument and StringBuilder Errors

Anonymous
Not applicable
806 Views
4 Replies
Message 1 of 5

Begginer issues ActiveUIdocument and StringBuilder Errors

Anonymous
Not applicable

Michael here

 

I have just started using the Macro API system, I have recently obtained a code example from one of my colleague and i am trying to get it to work.

I keep getting the ActiveUIDocument error and the StringBuilder Error. please see below screen grab of the code.

 

Cheers Michael

 

Screen Shot.JPG 

0 Likes
Accepted solutions (1)
807 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Accepted solution

StringBuilder is in System.Text, you need to be "using" that.  Assuming macros work the same way as C# code, if I can see the tiny text right, you're trying to get ActiveUIDocument from "this"... you want to get it from the Application passed in via the commandData parameter to Execute, not your class.  Have a look at some of the samples in the sdk.

0 Likes
Message 3 of 5

Anonymous
Not applicable

Thanks i got the system text to work, I will have a look through the SDK

 

 

Cheers

0 Likes
Message 4 of 5

Anonymous
Not applicable

Hi Andrea

 

I finally got it to work thank you for your help.

 

Cheers Michael

0 Likes
Message 5 of 5

Anonymous
Not applicable

Welcome!  🙂

0 Likes