REGEN3 via API

REGEN3 via API

phliberato
Advocate Advocate
1,618 Views
8 Replies
Message 1 of 9

REGEN3 via API

phliberato
Advocate
Advocate

Is there some way to call this Autocad command (REGEN3) by way of API .NET?

0 Likes
Accepted solutions (1)
1,619 Views
8 Replies
Replies (8)
Message 2 of 9

MateusMaciel
Advocate
Advocate

Document doc = Application.DocumentManager.MdiActiveDocument;

 

doc.Editor.Regen();

mateustilapa@gmail.com
0 Likes
Message 3 of 9

phliberato
Advocate
Advocate
Message 4 of 9

MateusMaciel
Advocate
Advocate

@phliberato sorry,

 

You have tried the following:

 

Document doc = Application.DocumentManager.MdiActiveDocument;

doc.SendStringToExecute("REGEN3\n", true, false, false);

 

In this case, it would run via a command prompt;

mateustilapa@gmail.com
Message 5 of 9

phliberato
Advocate
Advocate

I have already used this approach as workaround, but I'm looking for some API function approach.

0 Likes
Message 6 of 9

ChristianBlei
Advisor
Advisor

Hi Pedro,

 

I have a situation where I also need Regen3.

Did you find an API eqivalent to the command?

 

best regards to BeHo

 

Christian

Christian Blei
CBT Christian Blei Tools
christianblei.de
youtube.com/channel/UCxjA_NbeScQy9C0Z1xjwXpw
0 Likes
Message 7 of 9

Alexander.Rivilis
Mentor
Mentor
Accepted solution

Some years ago I received  next code from ADN DevHelp:

Document doc = Application.DocumentManager.MdiActiveDocument;
Autodesk.AutoCAD.GraphicsSystem.Manager mpManager = doc.GraphicsManager;
Autodesk.AutoCAD.GraphicsSystem.KernelDescriptor descriptor = 
                  new Autodesk.AutoCAD.GraphicsSystem.KernelDescriptor();
descriptor.addRequirement(Autodesk.AutoCAD.UniqueString.Intern("3D Drawing"));
Autodesk.AutoCAD.GraphicsSystem.GraphicsKernel kernal =
                  Autodesk.AutoCAD.GraphicsSystem.Manager.AcquireGraphicsKernel(descriptor);
 
Autodesk.AutoCAD.GraphicsSystem.Model Model = mpManager.GetDBModel(kernal);
 
Model.Invalidate(Autodesk.AutoCAD.GraphicsSystem.InvalidationHint.InvalidateAll);
 
Application.DocumentManager.MdiActiveDocument.Editor.Regen();

 

You can try it.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 8 of 9

phliberato
Advocate
Advocate

Hi @ChristianBlei ,

 

Good to see you here!

I didn't find an API eqivalent to this Regen3 command. However I noticed that in CAD recent versions the Regen command works well instead of Regen3 but I don't use the Regen function of Editor class, because it doesn't update the Project Explorer of Advance Steel. I submitted a pull request for the AS Dynamo plugin that I used this approach.

https://github.com/DynamoDS/Dynamo-Advance-Steel/pull/73/files

 

Maybe in your case the code that @Alexander.Rivilis sent it will work to you.

 

Best regards to Düsseldorf

0 Likes
Message 9 of 9

ChristianBlei
Advisor
Advisor

Hi Alexander,

 

thank you for sharing this snippet. It fixed the problems I have with representation of Advance Steel parts in 3D Visual styles, Conceptual ,e.g....

Do you recall differences to what Regen3 is doing?

 

best regards,

Christian

Christian Blei
CBT Christian Blei Tools
christianblei.de
youtube.com/channel/UCxjA_NbeScQy9C0Z1xjwXpw
0 Likes