Jump to content

Yotarou

Member
  • Posts

    18
  • Joined

  • Last visited

Everything posted by Yotarou

  1. sorry, I made a mistake. objAng:= GetSymRot(objHdl); HRotate(textHdl, txtCntrX, txtCntrY, -objAng);
  2. The text can be kept the horizontal by the way below. objAng:= GetSymRot(objHdl); HRotate(textHdl, txtCntrX, txtCntr, -objAng);
  3. The origin can be reset by the script. procedure ResetVWOrigin; var x, y :real; begin GetOrigin(x, y); SetOrigin(-x, -y); end; Run(ResetVWOrigin);
  4. Is this useful for you? http://techboard.vectorworks.net/ubbthreads/ubbthreads.php?ubb=showflat&Main=17161&Number=77285#Post77285
  5. Hi Jeff, These are the test code that there is LinearPIO in PointPIO. Please draw PointPIO, after registering PointPIO to Tool Palette. LinearPIO need not be registered. << PointPIO: Point-Plug-in Object >> PIO-Parameters: LPIO_Name: {LPIO-Name = 'LinearPIO'} LPIO_Text: {LPIO-Text} ControlPoint01X, ControlPoint01Y: {LPIO-StartPoint} ControlPoint02X, ControlPoint02Y: {LPIO-EndPoint} procedure PointPIO; var h :handle; lng, rot :real; v :vector; begin Locus(0, 0); v.X:= pControlPoint02X - pControlPoint01X; v.Y:= pControlPoint02Y - pControlPoint01Y; lng:= Norm(v); rot:= Vec2Ang(v); h:= CreateCustomObject(pLPIO_Name, pControlPoint01X, pControlPoint01Y, rot); if h <> nil then begin SetRField(h, pLPIO_Name, 'LineLength', Num2Str(-1, lng)); SetRField(h, pLPIO_Name, 'MyText', pLPIO_Text); ResetObject(h); end; end;{PointPIO} Run(PointPIO); << LinearPIO: Lenear-Plug-in Object (in PointPIO) >> PIO-Parameters: MyText: {LPIO-Text} procedure LinearPIO; begin MoveTo(0, 0); LineTo(pLineLength, 0); TextOrigin(pLineLength/2, 0); TextJust(2); TextVerticalAlign(3); if pMy_Text <> '' then CreateText(pMy_Text); end;{LinearPIO} Run(LinearPIO);
  6. I think that it is searchable from NameList() and GetObject().
  7. I think He want to know the method of knowing the difference between "3D Top View" and "2D Plan". If a simple method exists, I too want to know.
  8. I found this Tips last week. procedure test_GetSObj; const SelectedObjects = 2; TraverseShallow = 0; EditableLayers = 4; var hSObj :handle; function DoObject(h:handle):boolean; begin hSObj:= h; DoObject:= true; end;{DoObject} begin{main} hSObj:= nil; ForEachObjectInLayer(DoObject, SelectedObjects, TraverseShallow, EditableLayers); if hSObj = nil then Message('object = none') else Message('object type = ', GetType(hSObj)); end; Run(test_GetSObj);
  9. Try SelectObj((T=PlugInObject) & (R IN ['Chain Dimension'])); T: object type(= plug-in object) R: record's name(= 'Chain Dimension') Record's name has the possibility that is not "Chain Dimension" . Because I am VW11.5 user, I am not confirming it in VW12.5.
  10. Hi Grant, If you don't click on the screen, the plug-in tool cannot be executed. The plug-in menu is more appropriate.
  11. Try, procedure test; {$ DEBUG} var x, y, z :real; h :handle; begin h:= FActLayer; Layer('3d Loci'); while h <> nil do begin Get3DCntr( h, x, y, z); Locus3D(x, y, z); h:= NextObj(h); end; end; Run(test);
  12. Yotarou

    linelength

    Hi, Length and the angle of the line are examined by "HLength" and "HAngle".
  13. Try- criteria:= Concat('S=', '''', symbolName, ''''); if Count(criteria) = 0 then begin h:= GetObject(symbolName); if h <> nil then begin DelObject(h); end; end;
  14. It's impossible. However, the "Closed" function can be made. function Closed(hPoly: handle): boolean; var fPat:integer; begin fPat:= GetFPat(hPoly); SetFPat(hPoly, 0); if HArea(hPoly) = 0 then Closed:= false else Closed:= true; SetFPat(hPoly, fPat); end; {Closed} In most cases, this is faster than the "IsPolyClosed" function.
  15. Hi, Please see "VWPluginLibraryRoutines.p" in "Plug-ins" folder. There must be "IsPolyClosed" there. Function "IsPolyClosed" can be used in your script when existing.
  16. try- CreateText(concat(tex1, chr(13), text2));
  17. mattb, It's good in this? code: { code-1 } Locus(0, 0); hLoc:= LNewObj; h := FSActLayer; while h <> hLoc do begin hCenter(h,x,y); symbol(sym,x,y); hNext:= NextSObj(h);{not NextObj} DelObject(h); h := hNext; end; DelObject(hLoc); { code-2: The symbol is inserted in each original order. } h := FSActLayer; while h <> NIL do begin hCenter(h,x,y); symbol(sym,x,y); hSym:= LNewObj; HMoveBackward(hSym, TRUE); { The symbol is moved to the background of object(h). It's possible to omit this. } hNext:= NextObj(hSym); while hNext <> h do begin HMoveForward(hSym, FALSE); hNext:= NextObj(hSym); end; { } hNext:= NextSObj(h); DelObject(h); h := hNext; end; [/code] I'm not confirming this code's execution.
  18. Nice to meet you. I think that this is useful for you, though I might have misunderstood. code: { Data file - "Input File.txt" in VectorWorks Folder, text delimited in tab Name Symbol X Y Z (Name is unique name.) Name1 Sym1 0.0 0.0 0.0 Name2 Sym1 1.0 0.0 0.0 Name3 Sym2 2.0 0.0 0.0 Name4 Sym2 3.0 0.0 0.0 . . . } procedure Put3DSymbols; {$ DEBUG} const DataFile = 'Input File.txt'; Msg1 = ' is used other symbol.'; Msg2 = 'Do you replace it by a new symbol?'; Msg3 = ' is used other object.'; Msg4 = 'Do you replace it by a symbol?'; SymbolObj = 15; LF = Chr(13); var h :handle; x, y, z :real; x0, y0, z0 :real; name, sym, sym0 :string; dummy :string; procedure CreateSymbol(name, sym:string; x, y, z:real); begin NameObject(name); Symbol(sym, 0, 0, 0); Move3DObj(LNewObj, x, y, z); end;{CreateSymbol} begin{main} Open(DataFile); StdReadLn(dummy); while not EOF(DataFile) do begin ReadLn(name, sym, x, y, z); h:= GetObject(name); if h = nil then begin CreateSymbol(name, sym, x, y, z); WriteLn(name, ': is new symbol.'); end else begin if GetType(h) = SymbolObj then begin sym0:= GetSymName(h); if sym = sym0 then begin GetSymLoc3D(h, x0, y0, z0); if (x0 = x) & (y0 = y) & (z0 = z) then begin WriteLn(name, ': no operation.'); end else begin Move3DObj(h, x-x0, y-y0, z-z0); WriteLn(name, ': moved.'); end; end else begin if YNDialog(Concat('"', name, '"', Msg1, LF, Msg2)) then begin DelObject(h); CreateSymbol(name, sym, x, y, z); WriteLn(name, ': replace symbol"',sym0, '" to symbol"', sym, '".'); end else begin WriteLn(name, ': is other symbol"', sym0, '".'); end; end; end else begin if YNDialog(Concat('"', name, '"', Msg3, LF, Msg4)) then begin DelObject(h); CreateSymbol(name, sym, x, y, z); WriteLn(name, ': replace object(', GetType(h), ') to symbol"', sym, '".'); end else begin WriteLn(name, ': is other object(', GetType(h), ')'); end; end; end; ReDraw; end; Close(DataFile); end; Run(Put3DSymbols); { Log file is "Output File" or "Output.txt" in VectorWorks folder. }[/code]
×
×
  • Create New...