.NET

.NET

Reply
Distinguished Contributor
141 Posts
2 Kudos
Registered: ‎08-23-2011
Post 1 of 6
Accepted Solution

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

291 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*
1,569 Posts
171 Kudos
Registered: ‎10-08-2008
Post 2 of 6

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

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*
9,836 Posts
1,219 Kudos
Registered: ‎06-29-2007
Post 4 of 6

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*
1,569 Posts
171 Kudos
Registered: ‎10-08-2008
Post 5 of 6

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

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
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!