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

What is the proper way to scale a table ? .ScaleFactors doesn't work

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
JanetDavidson
618 Views, 5 Replies

What is the proper way to scale a table ? .ScaleFactors doesn't work

I am trying to scale down a table by half and "scale factor doesn't work. Am I doing something wrong ? it always come in original size and not scale - I tried to put the line before transaction and after appent and before , Here is Code.

Need help ,Thanks. 

Janet.

   Using tr As Transaction = Mydb.TransactionManager.StartTransaction
                    Dim btr As BlockTableRecord = tr.GetObject(Mydb.CurrentSpaceId, OpenMode.ForWrite)
                    btr.AppendEntity(tb)
                    tr.AddNewlyCreatedDBObject(tb, True)
                    tb.ScaleFactors = New Scale3d(0.5) 
                    tr.Commit()
  End Using

 

5 REPLIES 5
Message 2 of 6
Hallex
in reply to: JanetDavidson

Try this

 

tb.TransformBy(Matrix3d.Scaling(0.5, tb.Position))

tr.Commit()

 

Or perhaps

 

tb.ScaleFactors = New Scale3d(0.5,0.5,1.0)

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 3 of 6
JanetDavidson
in reply to: Hallex

Thanks Hallex,

Option one is not what I want . Because the scaling is in a point monitor event, and everytime user moves the mouse it scale down another time.

 

option 2 doesn't work either.

 

Appreciated your help though.

 

Janet.

 

Message 4 of 6

Hi,

 

>> Because the scaling is in a point monitor event, and everytime user moves the mouse it scale down another time

Then you check current size to decide if the table has to be scaled down or up or not, just one "if" ... 😉

....or there is something missing in your description to get that understandable for us.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 5 of 6
Hallex
in reply to: JanetDavidson

@Janet,

In this case you may want to use DrawJig

because of inside the event just SendStringExecute

is working properly and interactive command should be ignored

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 6 of 6

Alfred,  That was good point. men can think better . Happy new year.

 

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