.NET

.NET

Reply
Valued Contributor
72 Posts
0 Kudos
Registered: ‎07-21-2009
Post 1 of 6

Scale Objects On Screen Within Function

560 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
72 Posts
0 Kudos
Registered: ‎07-21-2009
Post 2 of 6

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*
753 Posts
54 Kudos
Registered: ‎02-13-2008
Post 3 of 6

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
331 Posts
12 Kudos
Registered: ‎05-11-2006
Post 4 of 6

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
141 Posts
2 Kudos
Registered: ‎08-23-2011
Post 5 of 6

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
331 Posts
12 Kudos
Registered: ‎05-11-2006
Post 6 of 6

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.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!