Jump to content

lucioing

Member
  • Posts

    45
  • Joined

  • Last visited

Everything posted by lucioing

  1. I mean the 'courier' code...
  2. One more thing... 😉 How do you PASTE the code? L.
  3. Ok. You are the greatest! Simply and efficient! Thank you Pat! L.
  4. Of course, I could simply write: PROCEDURE MakeBeam(xtrd:REAL); BEGIN BeginXtrd(0, xtrd); Cerchio(0, 0, 100); EndXtrd; END; but it doesn't make sense. what I'd like to get is send to the xtrd procedure, the proper sectionProfile... So if I have to make a tube, I'll send a 'CircleSection' or a 'WebSection' or a 'TubeSection'...
  5. You perfectly understand what I mean. Thank you, Pat L.
  6. what I mean... PROCEDURE MakeBeam(hSez: HANDLE; xtrd:REAL); BEGIN BeginXtrd(0, xtrd); somethings to put here! EndXtrd; END;
  7. Hi! I draw a poly by Poly( .... ); then I store it in 'MyPolyHandle' by MyPolyHandle:=LNewObj; Ok. Now, can I draw the poly by its Handle? Thank you L.
  8. I know... Thank you, Pat! L.
  9. Pat, I have to go from 2021 to 2023 and vice versa. I've learned to include code snippets, but if I need to add or change parameters, I'll have to do it manually If you have a trick to solve it, I'll be happy! But I fear not. Thank you for your reply L.
  10. Hi! Is there a way to create parameters via code?🤔 Thank you L.
  11. Oh my God... You right!!! I never, never, never thought of that! I feel I'm stupid, but not SO MUCH!!! Thank you, Jesse L.
  12. Now, I want to draw a simple rect and write, above it, the string from menu or button choice. PROCEDURE Example_1; VAR MyStr:STRING; MenuItem:INTEGER; result:BOOLEAN; BEGIN SetUnits(0,3,0,2.54,'cm','cmq'); { unità cm } result:=GetPluginChoiceIndex('Example_1', 'Nome', pNome, MenuItem); MyStr:=GetCustomObjectChoice('Example_1', 'Nome', MenuItem); Message(MyStr); <- I get nothing Rect(-100, 100, 100, -100); MoveTo(-100, 150); TextSize(12); CreateText(MyStr); <- and of course here too. END; Run(Example_1); ............................................................................... So, I wonder why. Maybe it is a very stupid bug, but I'm unable to see it. Is there someone who could help me, please? Thank you L.
  13. Thank you, Fuge! Yes, maybe the 'include file' could be the most clever choice! Thank you again.😃 L.
  14. Hi! I wrote a simple point object under VW2021 Mac (Hight Sierra). Then I moved it to my Macbook M1 Pro (VW2023) to improve and finish it. Ok, it works very nice, but I'm unable to install back in 2021 VW: the .vso file is in the right folder but I can't edit (script manager) and can't install in my workspace... Anyone knows why? Thank you. L. P.S. here's my simple object Container_02.vso
  15. Thank you very much, klinzey! It works very fine! Thank you again! L.
  16. Hi! A very simple trick. Draw a rectangle, just one, with simple measure... 400x300 for example then menu file -> export script Now you have the vs script for create a rectangle. Here is it: Procedure LoadFile; VAR hatchName, gradientName, tileName, materialName, objectName:STRING; result, index, segmentIndex:INTEGER; colorIndex:LONGINT; boolResult:BOOLEAN; top, left, bottom, right:REAL; tileRepPoint, tileOffPoint:POINT; tempHandle, tempHandle1, tempHandle2, tempHandle3, tempHandle4, tempHandle5, tempHandle6, gradientHandle, objectHandle, layerHandle, classHandle, viewportHandle, tileHandle, tileGroupHandle, materialHandle, textHandle:HANDLE; dynCharArray, tempDescriptionText:DYNARRAY [] OF CHAR; BEGIN {VectorWorks Version 26.0.5(6227681)} {Global Characteristics} DrwSize(1,1); SetUnits(0,1,0,2.54,'cm','cmq'); PrimaryUnits(0,1,1,2,6,TRUE,FALSE); SecondaryUnits(1,3,1,TRUE,TRUE); SetPrefLongInt(162,1); SetPrefLongInt(169,1); SetPrefLongInt(171,3); SetPrefLongInt(172,3); SetPrefLongInt(212,3); SetPrefLongInt(219,3); SetPrefLongInt(221,3); SetPrefLongInt(222,3); SetPrefInt(174,0); SetPrefInt(224,0); SetPref(167,FALSE); SetPref(173,TRUE); SetPref(223,FALSE); SetPref(175,FALSE); SetPref(225,TRUE); GridLines(1); PenGrid(0.1); SetPrefReal(73,0); SetOriginAbsolute(0,0); SetPref(37,TRUE); SetPref(38,TRUE); SetPref(5,FALSE); OpenPoly; SetPrefInt(121,0); SetPrefReal(68,0); SetPrefReal(69,0); SetPrefReal(70,1); {End of Global Characteristics} SetDocDrpShadowData(FALSE,0,0.01,0.005,#315.0000000000d,75,0,0,0); {Record Format Entries} {Begin Visible Record Format Entries} {End of Visible Record Format Entries} {Begin Hidden Record Format Entries} NewField('NNA__MassAndForceUnits','Mass Unit','2',1,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Mass Precision','2',1,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Show Mass Mark','True',2,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Custom Mass Unit Name','Kilogrammi',4,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Custom Mass Unit Mark','kg',4,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Custom Mass Unit Scale','1000',3,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Custom Mass Unit Link','2',1,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Custom Mass Unit Type','-1',1,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Mass Distr Unit','1',1,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Mass Distr Precision','2',1,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Show Mass Distr Mark','True',2,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Custom MassDistr Unit Name','',4,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Custom MassDistr Unit Mark','kg/m',4,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Custom MassDistr Unit Scale','1',3,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Custom MassDistr Mass Unit','2',1,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Custom MassDistr Lenght Unit','9',1,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Force Unit','1',1,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Force Precision','2',1,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Show Force Mark','True',2,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Custom Force Unit Name','Kilonewton',4,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Custom Force Unit Mark','kN',4,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Custom Force Unit Scale','1000',3,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Custom Force Unit Link','1',1,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('NNA__MassAndForceUnits','Custom Force Unit Type','-1',1,0); SetObjectVariableBoolean(GetObject('NNA__MassAndForceUnits'),900,FALSE); NewField('Setup Record_10','Version','26.0.1',4,0); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Active Class Std','1-VWArch',4,0); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Active Layer Std','1-VWArch',4,2); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Active Sheet Std','1-VWArch',4,0); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Num Basements','1',1,0); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Num Floors','2',1,0); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Use Zero','False',2,2); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Basement Prefix','B',4,0); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Floor Plan Scale','50.000000',3,6); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Site Plan Scale','200.000000',3,6); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Aux View Scale','50.000000',3,6); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Note Sheet Scale','1.000000',3,6); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Units','Centimetri',4,0); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Border Type','',4,0); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Title Block Type','',4,0); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Use Title Block Border','False',2,2); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Title Block Width','0,000000',4,0); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Title Block Height','0,000000',4,0); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Border Option','1',4,0); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','First Time-Setup','False',2,2); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','First Time-Model','True',2,2); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','First Time-Layers','True',2,2); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','First Time-Sheets','True',2,2); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Default Floor Height','106.299213',3,6); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Default Slab Thk','11.811024',3,6); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Default Bsmt Hgt','106.299213',3,6); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Default Fdn Thk','3.937080',3,6); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Default Ceiling Hgt','96.062992',3,6); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Has Roof','True',2,2); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Has Foundation','True',2,2); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Create Slab Layers','True',2,2); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); NewField('Setup Record_10','Use Auto-classing','False',2,2); SetObjectVariableBoolean(GetObject('Setup Record_10'),900,FALSE); {End of Hidden Record Format Entries} {End of Record Format Entries} {LineType Definition Entries} {End of LineTypeDefinition Entries} {Worksheet Entries} {End of Worksheet Entries} {Gradient Definition Entries} {End of GradientDefinition Entries} {Tile Definition Entries} {End of TileDefinition Entries} {LayerLevelType Entries} tempHandle := GetObject('Piano'); IF tempHandle = nil THEN boolResult := CreateLayerLevelType('Piano'); tempHandle := GetObject('Pavimentazione grezza'); IF tempHandle = nil THEN boolResult := CreateLayerLevelType('Pavimentazione grezza'); tempHandle := GetObject('Ambiente'); IF tempHandle = nil THEN boolResult := CreateLayerLevelType('Ambiente'); tempHandle := GetObject('Solaio'); IF tempHandle = nil THEN boolResult := CreateLayerLevelType('Solaio'); tempHandle := GetObject('Tetto'); IF tempHandle = nil THEN boolResult := CreateLayerLevelType('Tetto'); tempHandle := GetObject('Fondazione'); IF tempHandle = nil THEN boolResult := CreateLayerLevelType('Fondazione'); tempHandle := GetObject('Piano di calpestio'); IF tempHandle = nil THEN boolResult := CreateLayerLevelType('Piano di calpestio'); tempHandle := GetObject('Pavimento'); IF tempHandle = nil THEN boolResult := CreateLayerLevelType('Pavimento'); tempHandle := GetObject('Finitura pavimento'); IF tempHandle = nil THEN boolResult := CreateLayerLevelType('Finitura pavimento'); tempHandle := GetObject('Controsoffitto'); IF tempHandle = nil THEN boolResult := CreateLayerLevelType('Controsoffitto'); {End of LayerLevelType Entries} {Story Entries} {End of Story Entries} {Hatch Definition Entries} {End of Hatch Definition Entries} {-- Begin Simple Material Entries --} {-- End Simple Material Entries --} {-- Begin Compound Material Entries --} {-- End Compound Material Entries --} {Symbol Library Entries} {End of Symbol Library Entries} {Layer Characteristics} layerHandle := CreateLayer('Lucido design-1', 1); SetScale(50); ShowLayer; CopyMode(8); LFillFore(0,0,0); LFillBack(65535,65535,65535); LPenFore(0,0,0); LPenBack(65535,65535,65535); Projection(6,0,1239.519999999999754,-13.809133333333332,13.809133333333332,13.809133333333332,-13.809133333333332); {End of Layer Characteristics} {Object Creation Code} NameClass('Nessuna'); PenSize(2); PenPatN(2); FillPat(1); PenFore(0,0,0); PenBack(65535,65535,65535); FillFore(0,0,0); FillBack(65535,65535,65535); RectangleN(-214,-147,0.1,0,400,300); objectHandle := LNewObj; SetDropShadowData(objectHandle, 0,0.01,0.005,#315.0000000000d,75,0,0,0); EnableDropShadow(objectHandle, FALSE); objectHandle := LNewObj; SetObjectVariableBoolean(objectHandle, 1160, FALSE); SetZVals(0,0); OpacityN(100,100); {End of Creation Code} {Classes} NameClass('Nessuna'); SetClFillFore('Nessuna',0,0,0); SetClFillBack('Nessuna',65535,65535,65535); SetClPenFore('Nessuna',0,0,0); SetClPenBack('Nessuna',65535,65535,65535); boolResult := SetClassBeginningMarker('Nessuna',0,15,0.125,0,34,0.05); boolResult := SetClassEndMarker('Nessuna',0,15,0.125,0,34,0.05); SetClFPat('Nessuna',1); SetClLSN('Nessuna',2); SetClLW('Nessuna',2); SetCLDrpShadowData('Nessuna',0,0.01,0.005,#315.0000000000d,75,0,0,0); EnableCLDropShadow('Nessuna',FALSE); SetClUseGraphic('Nessuna',FALSE); classHandle := GetObject('Nessuna'); NameClass('Quote'); SetClFillFore('Quote',0,0,0); SetClFillBack('Quote',65535,65535,65535); SetClPenFore('Quote',0,0,0); SetClPenBack('Quote',65535,65535,65535); boolResult := SetClassBeginningMarker('Quote',0,15,0.125,0,34,0.05); boolResult := SetClassEndMarker('Quote',0,15,0.125,0,34,0.05); SetClFPat('Quote',1); SetClLSN('Quote',2); SetClLW('Quote',2); SetCLDrpShadowData('Quote',0,0.01,0.005,#315.0000000000d,75,0,0,0); EnableCLDropShadow('Quote',FALSE); SetClUseGraphic('Quote',FALSE); classHandle := GetObject('Quote'); {End of Class Entries} {Default Attributes} PenSize(2); PenPatN(2); FillPat(1); boolResult := SetDefaultBeginningMarker(0,15,0.125,0,34,0.05,FALSE); boolResult := SetDefaultEndMarker(0,15,0.125,0,34,0.05,FALSE); PenFore(0,0,0); PenBack(65535,65535,65535); FillFore(0,0,0); FillBack(65535,65535,65535); SetDocDrpShadwByCls(True); {End of Default Attributes} END; Run(LoadFile); But it has a lot of setting you don't need at the moment. It could simplified as below: Procedure LoadFile; VAR top, left, bottom, right:REAL; BEGIN {VectorWorks Version 26.0.5(6227681)} {Global Characteristics} DrwSize(1,1); SetUnits(0,1,0,2.54,'cm','cmq'); {End of Global Characteristics} {Object Creation Code} NameClass('None'); RectangleN(-214,-147,0.1,0,400,300); objectHandle := LNewObj; {End of Creation Code} END; Run(LoadFile); Pay attention that the Procedure " LOAD FILE " at the very top must to match to the RUN(LOAD FILE); That's all to start! Have fun L.
  17. Hi! I need to create containers, then I wrote a simple vs code. PROCEDURE Container_00; VAR MyStr:STRING; s:REAL; L_out: REAL; L_in: REAL; W_out: REAL; W_in: REAL; H_out: REAL; H_in: REAL; i:INTEGER; btn:STRING; r1Handle:HANDLE; r2Handle:HANDLE; BEGIN SetUnits(0,1,0,25.399999999999999,'mm','mmq'); s:=pSc; BeginXtrd(0, pHc); Rect(0, 0, pLc, pWc); r1Handle:=LNewObj; Rect(s, s, pLc-s, pWc-s); r2Handle:=LNewObj; ClipSurface(r1Handle, r2Handle); DelObject(r2Handle); EndXtrd; END; Run(Container_00); It does works correctly. Now, I'd like to set some standard measure, by radio button, as shown below but I'm unable to get the choice. First, CASE OF seems not to work with STRING but just INTEGER or CHAR... but I think to manage that. The only procedure I found is GetCustomObjectChoice('Container_00', 'Tipo', 1); which returns a STRING 🤔 besides, it doesn't make sense because I HAVE to set which ITEM (1) instead to GET the chosen item... PROCEDURE Container_00; VAR MyStr:STRING; s:REAL; L_out: REAL; L_in: REAL; W_out: REAL; W_in: REAL; H_out: REAL; H_in: REAL; i:INTEGER; btn:STRING; r1Handle:HANDLE; r2Handle:HANDLE; BEGIN SetUnits(0,1,0,25.399999999999999,'mm','mmq'); s:=pSc; btn:=pTipo; MyStr:=GetCustomObjectChoice('Container_00', 'Tipo', 1); CASE ???? OF 1: { custom size by edit field } BEGIN L_out:=pLc; W_out:=pWc; H_out:=pHc; END; 6: BEGIN { any choice with proper dimension } L_out:=12000; W_out:=2450; H_out:=2850; END; End; BeginXtrd(0, pHc); Rect(0, 0, pLc, pWc); r1Handle:=LNewObj; Rect(s, s, pLc-s, pWc-s); r2Handle:=LNewObj; ClipSurface(r1Handle, r2Handle); DelObject(r2Handle); EndXtrd; END; Run(Container_00); I can't found any example to manage the user choice by btn or menu. Thank you for any help Lucio
  18. Hi, Raymond! It does works fine! Thank you so much! This is the very first time I manage the WS via Vectorscript... Thank you again! Have a nice day Lucio PS. HTH... Of course! A great help!
  19. Anyway... I wonder: why, it doesn't works? SelectObj(T=WORKSHEET); WS_Handle:=FSActLayer; ObjectName:=GetName(WS_Handle); L.
  20. Now... what if I need to get the name of the selected sheet? Or get the Resource name? Thank you L.
  21. You can't imagine, how helpful has been your answer! Thank you so much L.
  22. Hi! It could be useful selecting all object of a class, by right clicking over the class pane as Rhino do. Thank you L.
  23. Hello to everyone! I'm in trouble with RHINO exporting. It seems to be impossible export by class or layer. Whatever you do, you get a single layer (in Rhino) that contains the whole project... As you can easily understand, it's not workable as it is. There is someone could help in this issue? Thank you L.
×
×
  • Create New...