Jump to content

BillW

Member
  • Posts

    77
  • Joined

  • Last visited

Reputation

27 Great

1 Follower

Personal Information

  • Occupation
    Architect
  • Location
    UK

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  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.
×
×
  • Create New...