Jump to content

BillW

Member
  • Posts

    77
  • Joined

  • Last visited

Everything posted by BillW

  1. I've just reported vs.SetObjectTags omision as a bug.
  2. Looks like SetObjectTags call is not implemented in Python (bug) - even though the call is available in Vectorscript. Sent DM to koenr.
  3. As an aside, I had a requirement to rebuild an extrude from scratch (ie. I couldn't unlink an association - bug) so I modified the example in the Wiki listed above. Could be easily changed to modify extrude height. Might want to transfer any data as well. Many moons ago I had some simple utilities written using the SDK (which I subsequently gave up and now out of mind) of which one was to change an extrude - see below. It would be nice to have this capability in vanilla VW as well as a getextrudeheights. procedure recreateextrude(extrH :HANDLE); VAR height, width, depth :REAL; xRot, yRot, zRot :REAL; p0X, p0Y, p0Z :REAL; p1X, p1Y, p1Z :REAL; result, isMirroredXY :BOOLEAN; shapeH,newextrH,tempH : HANDLE; begin result := Get3DOrientation(extrH, xRot, yRot, zRot, isMirroredXY); Get3DCntr(extrH, p0X, p0Y, p0Z); SetRot3D(extrH, 0, 0, 0, 0, 0, 0); Get3DInfo(extrH, height, width, depth); shapeH := FIn3D(extrH); {first shape in extrude} tempH := CreateDuplicateObject(shapeH,getparent(extrH)); newextrH := HExtrude(tempH,0,depth); SetClass(newextrH, GetClass(extrH) ); shapeH := NextObj(shapeH); while shapeH <> NIL do begin {other shapes in extrude} tempH := CreateDuplicateObject(shapeH,newextrH); shapeH := NextObj(shapeH); end; DelObject(extrH); {delete existing extrude} Set3DRot(newextrH, xRot, yRot, zRot , 0,0,0); Get3DCntr(newextrH, p1X, p1Y, p1Z); Move3DObj(newextrH, p0X-p1X, p0Y-p1Y, p0Z-p1Z); end; {recreateextrude} void CMyVSRoutines::OnSetExtrude(VWPluginLibraryArgTable& argTable) { MCObjectHandle extrH = argTable.GetArgument(0).GetArgHandle(); WorldCoord baseelev = argTable.GetArgument(1).GetArgReal(); WorldCoord thickness = argTable.GetArgument(2).GetArgReal(); gSDK->SetExtrudeValues(extrH,baseelev,thickness); }
  4. Don't think there is an automatic way although I stand to be corrected. But, in, for instance a plugin object, you could have the code content referenced by {$INCLUDE <codefilename>.px} (contained in the user Plug-Ins folder) which references the code file in Notepad and setup developer mode but you'll still have to "Recompile the script" I believe. You can also specify a pathname for the file. ie {$INCLUDE C:\Projects\Vectorworks\mytool\source scripts\mytool.px} I'm old school and prefer to copy/paste to the Plugin Editor. I sometimes do not immediately save a file in Notepad but wait till I get things working. If things don't work I reload the file in Notepad and start again. Been using Notepad for quite a while. I use Notepad Pascal language option much of the time (rather than Vectorscript User Defined Language) as the Function List tab displays the file routines. Although I do have a script to swap languages.
  5. I have various path based event driven path type plugins. I want to run some code once "Reshape Tool" is activated. Is there any event I can check? I can check if the user has entered/exited path editing via say double clicking with the following code (tested on a 3D path plugin): kObjOnAddState: begin{44} if vsoStateGetExitGroup(pioH,grptype) then begin eventmsg := vsoStateAddCurrent(pioH, eventmsg); {eventmsg = 0} {grptype = 2 = kObjXPropEditGroupPath } if (grptype = 2) then dosomething(pioH); end; end; TIA
  6. Haven't been successfull in finding a way to disable auto hide on the Object Info Palette. Not even a way to find out auto hide status which would be helpfull. Or even if pallete is undocked. Even tried Get/SetPaletteVisibility with names 'Object Info', 'Object Info - Shape', 'Resource Manager' to no avail. Only handles Tool palettes. Made a mistake - Palette Docking = 43 TRUE/FALSE
  7. Thanks klinzey. I thought that was the case with pathing. It's a pity vsoButtonGetResource doesn't handle what I want. However it allows access to any library folder which is a bonus. I had already implemented your suggestion to "create a small styles wall in the object's profile group" and it works well. Incidentally, I found when the Object Info Panel was undocked (with auto hide set) and I called vsoButtonGetResource via a PIO "vsoAddWidget" button, VW 2020-2023 would hang/crash. I need to investigate further. Is there any way I can disable auto hide? There are SetPref calls: Palette Docking = 41 TRUE/FALSE Allow Docking to Drawing = 6752 TRUE/FALSE Allow Internal Palette Docking = 6753 TRUE/FALSE Show Docked Document Tabs = 6754 TRUE/FALSE Controls the state in which docked palettes automatically hides based on mouse proximity = 6776 TRUE/FALSE I guess the last one is the one I need (I think). I found an interesting SetPref Turns screen redraws on/off = 6799 TRUE/FALSE which I assume Redrawall in code would update objects without performing a screen redraw (if FALSE).
  8. I have a button "Get Panel Style" in my plugin which I call vsoButtonGetResource for the user to select a panel style. I am using wall styles as panel styles. Folder "Panel Styles" contains the styles - see attached to see what I want to achieve (covering VW versions 2020 - 2024+). kWALLSTYLETYPE = 127; kPARAMNAME = 'panelstyle'; {param to store selection} kFOLDER = 'Panel Styles'; btest := vsoButtonGetResource(kPARAMNAME,kWALLSTYLETYPE,0,kFOLDER); {folder spec -113 = walls, 0 = Root} On clicking the button, I can't seem to open the browser into the "Panel Styles" folder showing only the contained styles. Currently, I get all the wallstyles in the file (0 = Root) Is there a particular syntax for "folderSpec" to open in a particular folder. Tried prepending with '/' to no avail. Even tried prepending the filename with '/' As an aside I am finding it tricky to workout if styles are renamed or deleted by the user. Thought of using (for first time): FUNCTION vsoStateGetNameChng(objH : HANDLE; VAR outOldName:STRING; VAR outNewName:STRING) :BOOLEAN ; but the current style is stored by name and if renamed by the user in the resouce browser I have no access via getobject(stylename). I cannot store style by handle as handles are dynamic. TIA
  9. The easiest way I would handle it is convert the polyline path to straight line segments use objH = vs.Polygonize(srcpathH,seglen,TRUE) and then step along the polygonized path, getting each vertex in turn to determine the vector (in relation to the previous vertex) for placing the rectangle extrudes. You even get a vector length which will pick up shorter segment lengths at line/curve transitions. The other advantage of Polygonize is that straight segements can also be split to seglen lengths (ie set as TRUE above).
  10. RefID's are assigned to planar objects and I suspect the current working plane doesnt have an assigned RefID unless the current working plane has already been assigned to an existing planar object. Depending on what you are doing in code, I think what you might be looking for GetWorkingPlane(VAR x,y,z,xRotation,yRotation,zRotation) ; and if you want to set an object to that plane, work out the offset and then SetEntityMatrix(objH,offsetX,offsetY,offsetZ,xRotation,yRotation,zRotation); I would need to check but if you set a working plane and draw say a rectangle whether it draws in relation to current working plane? I kind of doubt it. Other relevant calls are GetPlanarRef GetWorkingPlaneMat SetEntityMatrixN SetPlanarRef BillW
  11. You can get this to work by nesting a symbol within a symbol. The outer symbol c ontains another symbol and a Data tag and is set to convert to group on placement - see attached. Symbol DT to group.vwx
  12. I want to link two objects on different layers and figured I can use the "Association" calls for example AddAssociation( ioOwnerObj :HANDLE; inKind :INTEGER; ioTargetObj :HANDLE) :BOOLEAN; I notice there are only two association "kinds" kOnDeleteDelete = 4; {Target object is deleted when owner is deleted.} kOnDeleteReset = 5; {Target object is reset when owner is deleted.} Are there any others? I am looking for a kOnMoveDelete or a kOnMoveMove Also I noticed when I interrogate data tags with GetAssociation( HANDLE :HANDLE; index :INTEGER; VAR associationkind :INTEGER; VAR value :INTEGER) then the following kinds apply (Note index is zero based). Data tag = 37 Target object = 36 I also noticed if a source object with an association to a target object is copied then the association is lost on the new object which is good. Thanks
  13. Oops. I have found what I'm looking for. Calls are GetVPClassVisibility / SetVPClassVisibility GetVPLayerVisibility / SetVPLayerVisibility I just have to cycle through Class / Layer lists and check ON visibility status
  14. Does anybody know how to handle Classes and/or Layers associated with a Viewport. Preferably having Set/Get options. Tried to find some list handling routines but haven't found any calls yet. Thanks BillW
  15. Fill attribute error: That's an easy fix. I'll add to the next release when I fix the shape symbol bug (which worked in a previous release). Currently, the fill is taken from the class of the EP plugin instance. I have updated the zip file (now "Extrude Tools install 231027.zip") on my website at http://www.whwsolution.co.uk/vectorworks-extrude-path-tools/ to hopefully fix the install file bug. Can you give it a try. Due to the failing Mac install, I suspect it might be an idea to manually delete from the user plugins folder "...Plug-ins/Extrude tools" the following: folder: WW Tools VW files: Marionette EP Tools <VW version>.vwx VW workspace: Architect EP Tools.vww before a new install.
  16. You can pull through shape class textures by setting "Use shape classes" - see below. Each shape can have a different class.
  17. Just select "Reshape Tool" with the "Extrude Path Planar" object selected and directly edit - see below. You dont even need to set "Show Path". Incidently, you can draw an EP Planar object on a face by invoking WP auto face setting via "\" (backslash) where the current face below the cursor will be displayed in blue. Indeed "Shapes" are profiles and "Shape Symbols" can have many 2D shapes in a symbol definition all arranged in relation to the symbol origin (except I have a bug to fix) Currently, only one path is allowed in each path tool (which is a VW restriction for a 2D path object). However you can generate multiple EP planar objects from many selected 2D objects with "Edit or Build Extrude Objects" menu command - see below
  18. As an aside, I'm currently working on a tool "Extrude Cut Planar" which takes an edge path and creates spaced linear extrusions cut to the path and aligned with a user specified follow angle.
  19. @line-weight Thanks for testing. I'll start with the last message. In the zip file there is a file install.py Somehow spaces crept in between "pathconvert" and leading bracket (as well as other instances). I don't have mac and windows seems to accept this. I'll send a revised install file which you can replace in the zip file but I can't seem to add a python file to the message. If you want, DM me with perhaps an email address. In the interim you can manually install by unzipping the zip file and copying the plugins shown below to your (mac equivalent) Vectorworks user directory Copy "Architect EP Tools.vww" to the Vectorworks user "Workspace" directory. Marionette isn't that important right now. On your first message, I can have multiple shapes in a symbol definition similar to your example and edit live with the "Reshape Tool". Any symbols (containing 2D shapes) in a symbol folder "Shape Symbols" (or in any contained Symbol folders) can be referenced in the Tools OI panel. Easiest way to create "Shape Symbols" folder is to add an EP tool with Symbol type selected. However, I have noticed a bug with symbols which needs more work.
  20. Not exactly what is wanted but if you can get a 3D surface, split how you want, which can be converted to a group of 3D polygons, I have a set of tools that can create offset panels. As a side note there are some interesting plugins in Blender which may be useful ie Mesh: Geodesic Domes and Mesh:Tissue I converted one of my plugins "Faceted Hemisphere" to a group of 3D polys and created the results shown below. It can take a bit of time to process but the advantage of the plugins is that the panel and shape settings can be changed. Note the normals of the 3D polys initially face inwards (I believe) however the faces can be reveresed before processing.
  21. I have just updated the autocompletion file "pascal.xml" for Vectorscript 2024. Find enclosed amended file. Replace existing file in folder "notepad plus\autoCompletion" Calls added are: CreateBorderlessBtn CreateBorderlessMenu CreateDataVisPDMenu GISDimStringToMM GetProjectElevation IFC_GetStructureGUID IFC_ReadProjectData IFC_SetStructureGUID IFC_WriteProjectData IsResourceReferenced SM_FromShape SM_Preferences SetProjectElevation Space_FullyReset Any problems drop me a line at info@whwsolution.co.uk pascal.xml
  22. Recently I moved to Notepad++ for coding and have a full environment geared to Vectorscript. If interested, information can be found at http://www.whwsolution.co.uk/tag/vectorscript select post “Vectorworks: Notepad++ for Vectorscript” - download documentation PDF "notepad for vectorscript" for information on implementation/installation. - download "notepad plus extras.zip" file - unzip in your prefered location on your computer - copy the following files to your Notepad++ installation directory as indicated. Any problems drop me a line at info@whwsolution.co.uk Find enclosed two flyer images giving an idea on the implementation. The Notepad Pythonscript plugin allows extending of the environment which is impressive. It was a good exercise to understand how regex works in Python.
  23. Recently I moved to Notepad++ and have a full environment geared to Vectorscript but need to package and document. In the interim, find included an auto completion file for "Pascal" which is up to date for Vectorscript VW 2023. Place in the folder "notepad plus/autoCompletion" and set language to "Pascal". I also used the "Style Configurator" to add "User-defined keywords" to "Pascal" for Vectorscript specific "INSTRUCTION WORD"s. Find attached "stylers.xml" which replaces file in folder "Notepad plus". Rename the old one first if you want to keep for reference. Valid Vectorscript file extensions are ".vss" or ".px" Notepad implements plugins which add powerfull ways of improving the environment, particularly PythonScript plugin QuickText plugin NppSnippets plugin I wrote a python parser to get content from the Vectorscript Language Reference (HTML) which picked up procedure/function, parameters and description and was written to the autocomplete file. Needed a bit of prep work first though. In future, I will probably add new Vectorscript calls by hand. Note, if you type a bracket after a valid VS call, you get a popup message for the call. I have my own user defined language for Vectorscipt but I am having problems with the plugins and autocompletion not recognising the UDL so I use Pascal instead. Need to investigate further. I tend to install the portable version of Notepad++ so I can put on a memory stick. pascal.xml stylers.xml
  24. @line-weight >>Is the plan to offer these as paid-for tools eventually? Yes. Ultimately I'd like to have some reward for all the effort put in. Not sure how to set things up yet. Also depends if there is a demand. Thanks for the interest.
  25. If anyone's interested, I have been sitting on some Extrude Path Tools/environment for quite some time (started 2007) and am in a final testing phase. 3D modelling work took precedence hence the long wait. Main tools shown below (for VW2020 upwards) For further information: visit http://www.whwsolution.co.uk/vectorworks-extrude-path-tools/ Download ====================================================== "Extrude tools documentation" for usage and installation details. "Extrude Tools install 230824.zip" and install via Tools>Plug-ins>Plug-in Manager...>Third-party Plug-ins>Install... "Extrude Tools content 230428.zip" for examples. There is even a Marionette interface in file "Marionette EP Tools <version>" - although not updated/tested in a while. Some interesting options are: Draw any 2D/3D object (apart from subdiv) and convert to extrude path pio's via "Edit of Build Extrude PIOs" Convert 2D shapes,2D/3D loci, 3D objects or existing symbols/PIOs to new symbol definition via "Convert to Symbols". Convert 2D/3D objects and split by segment or to a locus(symbol) at various locations via "Convert from Faces" Both can be used for conversion via "Edit of Build Extrude PIOs" By turning off "Show Path" (a VW restriction not allowing other non 3D objects in PIO) for EAP's you can do boolean operations on the generated 3D geometry. Similarly for example draw a rectangle and extrude. Note: Shape symbols must contain screen based 2D shapes only and be located in "Shape Symbols" folder or below. Also, reduce geometry size via "Sharp Corners" option for shape plugins. Example on website is a Subdiv, converted to a 3D poly set, bottom sliced off, converted to Linear Path PIO's via convert to lines and connector symbols placed via conversion to loci. Coverted 3D poly set has glass material applied. Note: subdivs can produce non planar 3D polys which can be fixed via "Set 3D Polys Planar" Any problems drop me a line - regards BillW
×
×
  • Create New...