• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    .NET

    Reply
    Distinguished Contributor
    JanetDavidson
    Posts: 139
    Registered: ‎08-23-2011
    Accepted Solution

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

    208 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

     

    Please use plain text.
    *Expert Elite*
    Hallex
    Posts: 1,332
    Registered: ‎10-08-2008

    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
    Please use plain text.
    Distinguished Contributor
    JanetDavidson
    Posts: 139
    Registered: ‎08-23-2011

    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.

     

    Please use plain text.
    *Expert Elite*
    Posts: 6,415
    Registered: ‎06-29-2007

    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
    -------------------------------------------------------------------------
    Please use plain text.
    *Expert Elite*
    Hallex
    Posts: 1,332
    Registered: ‎10-08-2008

    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
    Please use plain text.
    Distinguished Contributor
    JanetDavidson
    Posts: 139
    Registered: ‎08-23-2011

    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.

     

    Please use plain text.