.NET

.NET

Reply
Distinguished Contributor
JanetDavidson
Posts: 141
Registered: ‎08-23-2011
Message 1 of 6 (289 Views)
Accepted Solution

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

289 Views, 5 Replies
12-25-2011 11:27 PM

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

 

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" ... :smileywink:

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

 

- alfred -

*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 2 of 6 (276 Views)

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

12-26-2011 06:51 AM 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
Distinguished Contributor
JanetDavidson
Posts: 141
Registered: ‎08-23-2011
Message 3 of 6 (262 Views)

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

12-26-2011 10:47 PM 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.

 

*Expert Elite*
Alfred.NESWADBA
Posts: 9,600
Registered: ‎06-29-2007
Message 4 of 6 (260 Views)

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

12-26-2011 10:59 PM in reply to: JanetDavidson

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" ... :smileywink:

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

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 5 of 6 (257 Views)

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

12-26-2011 11:20 PM 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
Distinguished Contributor
JanetDavidson
Posts: 141
Registered: ‎08-23-2011
Message 6 of 6 (239 Views)

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

01-02-2012 12:44 AM in reply to: Alfred.NESWADBA

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

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.