Jump to content

Peter Vandewalle

Member
  • Posts

    220
  • Joined

  • Last visited

Everything posted by Peter Vandewalle

  1. Or use saved views to turn off the layers you don’t need when working at another scale?
  2. Since unified view exists, I never turned it off. Different scales shown together is done in sheet layers… Or am I missing something?
  3. Move a resource to a folder: I think SetParent()…
  4. Documentscript with Message(GetTypeN(GetObject(‘textstylename’))) will get you the answer.
  5. You can make database formulas smarter by using a "Databasebyscript" formula. Of course you'll need to script the list of shown objects yourself.
  6. Pat is right. But I think a script could make it semi-automatic. If the worksheets have a name beginning with something recognizable, you could select them, get the instance layer and update the database formula. Also, have the layer name in a cell and have the database formula use that cell as a reference. Like “(L=A1)”. That’ll make it easier to update your worksheet.
  7. Libraries are always version dependent. You’ll need a folder by version, just like the user folders.
  8. Workgroup folders are the way to go. Google Drive has a sync option, you can just create your workgroup folder in the drive. You CAN also update your workgroup folder library directly from within Vectorworks. if you add a workgroup folder in the Vectorworks preferences, the correct structure will be created at the chosen location. To add you library to it, just copy it via Explorer/Finder. Once the library has been added you can add new symbols by dragging them in the ressource browser from your active file to the wanted location in the workgroup folder.
  9. This sounds more like a command. Typically in Vectorworks, commands are menu commands. You can of course attach a keyboard shortcut to a command. Tools and Objects always need a click in the drawing to execute.
  10. Actually "vs.WSScript_GetEdit" returns a boolean if a change was made by the user and returns the user-entered value. But the "vs.WSScript_GetEditObj" should return a handle to the edited object.
  11. Sorry for my misunderstanding. I don’t think there is a way to script the collapsing.
  12. Yes there is. The PIO must be event-enabled. I'm doing this in Python, but it should also work in Vectorscript. In the Event 5 (kObjOnInitXProperties) routine, include these 3 lines: Python: _bResult = vs.SetObjPropVS(8, True) # kObjXPropHasUIOverride _bResult = vs.SetObjPropCharVS(81, vs.Chr(2)) # kWidgetGroupMode, kWidgetGroupAutomatic object_info_palet(_sPIOName) Vectorscript: bResult = SetObjPropVS(8, TRUE); {* kObjXPropHasUIOverride *} bResult = SetObjPropCharVS(81, Chr(2)); {* kWidgetGroupMode, kWidgetGroupAutomatic *} ObjectInfoPalet(sPIOName); The last line calls these procedures. At least that's how I do it. Python: def object_info_palet(_sPIOName): _iPIOID = 100 _iPIOID = insert_separator(_iPIOID, _sPIOName, "Global", 0) _iPIOID = insert_parameter(_iPIOID, _sPIOName, "LineLength", 1) _iPIOID = insert_parameter(_iPIOID, _sPIOName, "Diepte", 1) def insert_separator(_iID, _sPIOName, _sParameter, _iIndent): _bResult, _sTmp = vs.GetLocalizedPluginParameter(_sPIOName, _sParameter) if _bResult: _bResult = vs.vsoAddWidget(_iID, 100, _sTmp) _bResult = vs.vsoAppendWidget(100, _iID, _sTmp, 0) vs.vsoWidgetSetIndLvl(_iID, _iIndent) return _iID+1 def insert_parameter(_iID, _sPIOName, _sParameter, _iIndent): _bResult, _sTmp = vs.GetLocalizedPluginParameter(_sPIOName, _sParameter) if _bResult: _bResult = vs.vsoAddParamWidget(_iID, _sParameter, "") _bResult = vs.vsoAppendParamWidget(_iID, _sTmp, 0) vs.vsoWidgetSetIndLvl(_iID, _iIndent) return _iID+1 Vectorscript: PROCEDURE ObjectInfoPalet; VAR iPIOID: INTEGER; BEGIN iPIOID := 100; iPIOID := InsertSeparator(iPIOID, sPIOName, 'Global', 0); iPIOID := InsertParameter(iPIOID, sPIOName, 'LineLength', 1); iPIOID := InsertParameter(iPIOID, sPIOName, 'Depth', 1); ... END; FUNCTION InsertSeparator(iID: INTEGER; sPIO, sField: STRING; iIndent: INTEGER): INTEGER; VAR bResult: BOOLEAN; sTmp: STRING; BEGIN bResult := GetLocalizedPluginParameter(sPIO, sField, sTmp); IF bResult THEN BEGIN bResult := vsoAddWidget(iID, 100, sTmp); bResult := vsoAppendWidget(100, iID, sTmp, 0); vsoWidgetSetIndLvl(iID, iIndent) END; InsertSeparator := iID + 1; END; FUNCTION InsertParameter(iID: INTEGER; sPIO, sField: STRING; iIndent: INTEGER): INTEGER; VAR bResult: BOOLEAN; sTmp: STRING; BEGIN bResult := GetLocalizedPluginParameter(sPIO, sField, sTmp); IF bResult THEN BEGIN bResult := vsoAddParamWidget(iID, sField, ''); bResult := vsoAppendParamWidget(iID, sTmp, 0); vsoWidgetSetIndLvl(iID, iIndent); END; InsertParameter := iID + 1; END; I hope the Vectorscript is correct, I do more Python these days.
  13. You can set the starting position of the control point in the parameter settings in the plug-in creation dialog.
  14. Your GiveMeAX and GiveNeAY are constants. You don’t read the ControlPoint values. Try this (I did this on my iPhone so there are no indents): Procedure Test; CONST CR = CHR(13); VAR objHd,recHd,wallHd, ControlGeometry : HANDLE; resultStatus : BOOLEAN; objName, currentClass : STRING; i : INTEGER; rX, rY: REAL; BEGIN PushAttrs; currentClass := ActiveClass; resultStatus := GetCustomObjectInfo(objName,objHd,recHd,wallHd); ControlGeometry := GetCustomObjectPath(objHd); SetObjectVariableBoolean(objHd, 800, TRUE); rX := pControlPoint01X; rY := pControlPoint02Y; RectangleN( 0, 0, 1, 0, rX, rY); RectangleN( rX, rY, 1, 1, 20mm, 20mm); NameClass(currentClass); PopAttrs; END; RUN(Test);
  15. You’ll need to start by creating a parametric object in the plug-in editor in the tools menu. You could create a rectangular object, that’s one of the options. In the same plug-in editor you can also add parameters and add the script. That can be Vectorscript or Python. you can also import an external file into that script. That external file can then hold the main part of the script.
  16. For Pats example ‘door’.’usrfield1’ use this line to get the value into an internal variable: var = vs.Pusrfield1 or: var = vs.GetRField(<handle to PIO instance>, “door”, “usrfield1”)
  17. You’ll find the plug-in editor in the tools menu. In the plug-in editor you can create an additional plug-in. I think the reducer would be a point object or a line object. You ‘ll need to add a few parameters to the plug-in object. This can be done in the plug-in editor. Last but certainly not least, you’ll need to write the script. This can be Vectorscript or Python. The script can be written in the plug-in editor or referenced to an external text file (.px for Vectorscript, .py for Python). Also, check the developer website for reference. developer.vectorworks.net Of course there are at least a thousand more things to tell about scripting in Vectorworks.
  18. The only solutio I'd see is to add a record to all the involved symbols and have a specific field indicate the desired layer upon insertion. So after inserting the symbol a script could read the record field value an move the object (symbol) to the correct layer. It could even create the layer if that one doesn't exist yet.
  19. @drelARCH: Very interesting nodes by @Takeshi_Kimura but unfortunately there's no 'materials popup' node in his list either.
  20. I'm building a simple hybrid object in Marionette. Now I'd like to use materials in the object. There seem to be no nodes for materials in Marionette. I'm missing 2 nodes: A 'materials popup' node to select a material from the available materials in the current document. A 'set material' node to attach a material by name to an object by handle. I've been able to create the latter. But when I create the 'materials popup' node, I'm running into an issue. When I create the node, it lists the materials in the document correctly, but when I add a material to the document, it doesn't update except when I save the current document... I'm attaching my custom nodes. Geëxporteerd bestand Marionette.vwx
  21. I think Pat is handing the best solutions. If your case doesn't act as expected, we need to see the actual drawing and selection you're using. Maybe we can find why it's not acting as you'd expect.
  22. Hello @Edgar RAMEL I solved the issue withe the units in the script, that's why it's working as it does. I just wanted to explain why the previous version was wrong. The fact that the command changes the selected object's settings to class settings was also a choice that I made because it seemed logic to me. You can always remove the class attributes by hand afterwards.
  23. Sorry, didn't find the time to sort it out earlier. There are some issues between reading and writing of the dropshadow values. By reading, they are always in mm, for writing they need to be document units... Finally, you can try this one. Object Attributes to Class_2021_03.zip
  24. New version, should be fixed now. Object Attributes to Class_2021_02.zip
×
×
  • Create New...