Jump to content

Bertf

Member
  • Posts

    80
  • Joined

  • Last visited

Everything posted by Bertf

  1. Thank you BillW! x1,y1 = vs.vstGetCurrPt2D() -> This works!
  2. Hi, JBenghiat. I've tried your suggestion and it works when I create a command but it doesn't when I create the same code in a tool. Any reason for that? Thank you (code below) import vs; def PickPointCallback(pt): vs.AlrtDialog( "Point {0}:{1}".format(pt[0],pt[1]) ) vs.GetPt( PickPointCallback )
  3. Hi, I'm having troubles to get vs.GetPt() working. What I have is a plugin written in Python that places a textbox with text from the plugin parameters on the mouse last location. -> This works (code below) Although vs.GetMouse isn't so precisely because when moving the mouse fast after clicking, I receive another location. So I want to use the Getpt() function. Is there any way to get vs.GetPt() working? Or am I doing something wrong? p = vs.GetMouse() CabinetNr = getattr(vs, 'PKastNr') Material = getattr(vs, 'PMateriaal') Text = 'K'+ CabinetNr + chr(13) + Material Length = len(Text) PosEnter = Text.index(chr(13)) #p = vs.GetPt() --> NOT WORKING HERE vs.TextOrigin(p) vs.CreateText(Text) h = vs.LNewObj() vs.SetTextFont(h, 0, Length, vs.GetFontID('Arial')) vs.SetTextSize(h, 0, PosEnter, 12) vs.SetTextSize(h, PosEnter, Length-PosEnter, 7) Thank you, Bert
  4. Thank you very much Marissa! Works like a charm now
  5. Hi, When using a function like vs.SetTextFont(objectHd, Start, Count, FontNum), I need an object handler (objectHd) that points to the textbox of which the function has to change the font. my code: h = vs.CreateText('Hello') vs.SetTextFont(h, 0, vs.GetTextLength(h), vs.GetFontID('Arial')) This gives the error: Handle to text object is not valid. What am I doing wrong? :confused: The output of createText is a Handle and the SetTextFont asks for a handler? Thank you! Bert
×
×
  • Create New...