.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Scale Objects On Screen Within Function

5 REPLIES 5
Reply
Message 1 of 6
vampirefromtheITcave2
944 Views, 5 Replies

Scale Objects On Screen Within Function

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.

 

 

5 REPLIES 5
Message 2 of 6

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

Message 3 of 6

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
Message 4 of 6

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.

 

 

 

 

Message 5 of 6
JanetDavidson
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.

 

Message 6 of 6
cadMeUp
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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost