Jump to content

BillW

Member
  • Posts

    77
  • Joined

  • Last visited

Posts posted by BillW

  1. 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);
    }

     

  2. 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.

  3. 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

     

     

  4. 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

  5. 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).

     

  6. 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

     

    vsoButtonGetResource.jpg

  7. 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).

  8. 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

  9. 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

     

  10. 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.

     

  11. 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.

     

     

    EPtoolreshapeedit.thumb.jpg.bc06e74cbd03091aaa2f77469f331f97.jpg

     

    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

     

    editorbuildextrudeobjects.thumb.jpg.6379d6034a0068e9956a59ab621b2274.jpg

  12. @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

     

    manualinstall.jpg.d824d722482b8a306c1abaa1bd845146.jpg

     

    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.

     

    • Like 1
  13. 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.

     

    Panelizegrouped3Dpolygons.thumb.JPG.f5501cc2ff3501d63d06d4da6c7ec4ac.JPG

    facetedhemisphere.thumb.png.a410241b43c647712b7098fcf3b211d7.png

     

    • Like 3
  14. 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

    • Like 1
  15. 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.

    notepadflyer_1.thumb.jpg.96b6dcdcf55a8571b3042eb45c87d035.jpg

    notepadflyer_2.thumb.jpg.e92153db2c6edaded184e446966c6ec1.jpg

     

    • Love 4
  16. 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

    • Like 1
    • Love 1
  17. 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)

    VectorworksExtrudeToolssmall.thumb.jpg.d6ff42051f29dfad66b8678a183f2355.jpg

     

    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

    • Like 1
×
×
  • Create New...