.NET

Reply
Valued Contributor
vampirefromtheITcave2
Posts: 72
Registered: ‎07-21-2009
Message 1 of 6 (555 Views)

Scale Objects On Screen Within Function

555 Views, 5 Replies
10-07-2010 11:52 AM

I have a function that uses AcadApplication.ActiveDocument.SendCommand to allow the user to scale the inserted lines and text before the next step of the process, but AutoCAD does not display the scale prompt until after the entire program finishes.  The prompt works well, but needs to be displayed before I end the sub.

 

How do I get the command to be sent immediately?  Is there another way to allow users to scale the items I insert?  The screen needs to be refreshed before the scale command is called, so that the lines and text I just added shows up.  I have attached the code for the SendCommand call and for the function that calls it.  Please let me know if additional information is needed.

 

 

Valued Contributor
vampirefromtheITcave2
Posts: 72
Registered: ‎07-21-2009
Message 2 of 6 (502 Views)

Re: Scale Objects On Screen Within Function

10-11-2010 05:27 AM in reply to: vampirefromtheITcave2

Someone answer please. If you need more information, let me know.

*Expert Elite*
chiefbraincloud
Posts: 752
Registered: ‎02-13-2008
Message 3 of 6 (429 Views)

Re: Scale Objects On Screen Within Function

10-20-2010 04:30 PM in reply to: vampirefromtheITcave2

Sorry no one bothered to comment (Including me).  I had started to throw together an example, but I hit a snag and have not been able to spend the time to work it out.

 

I think you want to look into a DrawJig.  Getting the WorldDraw override working correctly will be the tricky part.

 

Dave O.                                                                  Sig-Logos32.png
Valued Mentor
cadMeUp
Posts: 331
Registered: ‎05-11-2006
Message 4 of 6 (390 Views)

Re: Scale Objects On Screen Within Function

10-21-2010 07:59 PM in reply to: vampirefromtheITcave2

using DrawJig to drag draw your ents, you could avoid using the "_scale " command.  

The attached code sample gives the basic idea of scaling a block ref, but could be adapted to draw a collection of entities passed into the instance and then within WorldDraw() transform (Matrix3d.Scaling()) each entity within the collection before calling draw.Geometry.Draw() on each entity.

 

 

 

 

Distinguished Contributor
JanetDavidson
Posts: 139
Registered: ‎08-23-2011
Message 5 of 6 (154 Views)

Re: Scale Objects On Screen Within Function

12-23-2011 01:07 AM in reply to: cadMeUp

Hello , CadMeUp,

I am trying to use your code and can't even know how to call this class,

Can you please help me and tell me how to call your class .

I mean If I want to user  <commandmethod> . what should be in sub to call your class?

Thanks,

Janet.

 

Valued Mentor
cadMeUp
Posts: 331
Registered: ‎05-11-2006
Message 6 of 6 (102 Views)

Re: Scale Objects On Screen Within Function

12-26-2011 07:00 PM in reply to: JanetDavidson

Sorry for the late reply here, attached is a more detailed C# code file and a test dwg. The code file contains everything needed to compile and execute the command. You can tweak it as needed. I haven't produced the VB equivalent of the code as yet.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community