VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Scale Problem.

3 REPLIES 3
Reply
Message 1 of 4
Bharathi
225 Views, 3 Replies

Scale Problem.

Hello,

I want to scale the drawing.below i write the code for that.code have some problem.

ThisDrawing.SendCommand ("sc" & vbCr)
ThisDrawing.SendCommand ("all" & vbCr & vbCr)

ThisDrawing.SendCommand ("0,0" & vbCr) 'when the cursor come to this line, cursor point go automatically to autocad drawing for manual input.
after pressing enter and i have give input "r"

ThisDrawing.SendCommand ("r") 'this line also not working.
ThisDrawing.SendCommand ("2.625" & vbCr)
ThisDrawing.SendCommand ( "2" & vbCr) 'this line also not working.

i need all input thru program like this,where i did mistake,

ThisDrawing.SendCommand ("sc" & vbCr)
ThisDrawing.SendCommand ("all" & vbCr & vbCr)
ThisDrawing.SendCommand ("0,0" & vbCr)
ThisDrawing.SendCommand ("r")
ThisDrawing.SendCommand ("2.625" & vbCr)
ThisDrawing.SendCommand ("2" & vbCr)

herewith i attach drawing for reference.

Thanks in advance,
bharathi
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Bharathi

Why use sendcommand? There's an ActiveX method to do this. An example using
your data:

Sub scalemodel()
Dim oEnt As AcadEntity
Dim dVal As Double
Dim dBase(2) As Double

dVal = 2# / 2.65
For Each oEnt In ThisDrawing.ModelSpace
oEnt.ScaleEntity dBase, dVal
Next

End Sub


wrote in message news:5662569@discussion.autodesk.com...
Hello,

I want to scale the drawing.below i write the code for that.code have some
problem.

ThisDrawing.SendCommand ("sc" & vbCr)
ThisDrawing.SendCommand ("all" & vbCr & vbCr)

ThisDrawing.SendCommand ("0,0" & vbCr) 'when the cursor come to this line,
cursor point go automatically to autocad drawing for manual input.
after pressing enter and i have give input "r"

ThisDrawing.SendCommand ("r") 'this line also not working.
ThisDrawing.SendCommand ("2.625" & vbCr)
ThisDrawing.SendCommand
( "2" & vbCr) 'this line also not working.

i need all input thru program like this,where i did mistake,

ThisDrawing.SendCommand ("sc" & vbCr)
ThisDrawing.SendCommand ("all" & vbCr & vbCr)
ThisDrawing.SendCommand ("0,0" & vbCr)
ThisDrawing.SendCommand ("r")
ThisDrawing.SendCommand ("2.625" & vbCr)
ThisDrawing.SendCommand ("2" & vbCr)

herewith i attach drawing for reference.

Thanks in advance,
bharathi
Message 3 of 4
Bharathi
in reply to: Bharathi

Hello Jeff Mishler,

Thanks for your reply.After scale i have to extract data to excel sheet.if i didnt do scale, data didnt export.if i do with scale coding,after that i cant able to export.so i try to use send command.while using send command by manually in autocad, i am able to export data to excel sheet.thats why am using send command.I dont know where I did mistake.for extracting data i am using selection set points.

for ex:(below points are after scaling)
Set oSset = adoc.SelectionSets.Add(setName)
Dim p1(2) As Double
p1(0) = 11: p1(1) = 21: p1(2) = 0#
Dim p2(2) As Double
p2(0) = 155: p2(1) = 77: p2(2) = 0#
oSset.Select acSelectionSetWindow, p1, p2, dxfcode, dxfdata

Thanks again,
bharathi
Message 4 of 4
jbooth
in reply to: Bharathi

May I ask why you are scaling the entire drawing instead of changing the user's view via the zoom command?

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

Post to forums  

Autodesk Design & Make Report

”Boost