
BillW
Member-
Posts
90 -
Joined
-
Last visited
-
Excellent. Thanks JBenghiat. Using ForEachObjectInLayer is much more elegant than my current solution - see code below I found the button invoking my dialog deselected all objects, so I still need to store the selected objects prior to the dialog display. I have a maximum size of array set as kMAXSEL so once reached the search is terminated. I could extend the array with Allocate but not really necessary. This works with plugins inside a group or symbol once entered for editing as well as plugins selected on multiple design layers and Layer Options> "Show/Snap/Modify Others" set. You are right that all selected objects must be of the same plugin type. procedure getpioselection; function getselobjs(objH: HANDLE) :BOOLEAN; begin gselcnt := gselcnt + 1; gselobj[gselcnt] := objH; getselobjs := (gselcnt = kMAXSEL); {stop recording once maxsel reached for gselobj} end; { getselobjs } begin gselcnt := 0; ForEachObjectInLayer(getselobjs, 2, 0, 3); end; {getpioselection} procedure setpioselection; Var i : INTEGER; objH : HANDLE; begin for i := 1 to gselcnt do begin objH := gselobj[i]; setshapedefs(objH); resetobject(objH); SetSelect(objH); end; end; {setpioselection}
-
Is there any way to detect if Layer Options> "Show/Snap/Modify Others" is currently set. I have had a look through "VectorScript Appendices" and haven't found any applicable selector. With plugins, if you have multiple same type plugins selected, then if a parameter (eg Boolean) is changed (ie clicking a checkbox) then that setting ripples down to all same selected plugins. However, I have a button activated dialog which is used to set other hidden parameters and some visible parameters which does not trigger the rippling down to the same selected plugins. The way I get around this problem is to store a list of same selected plugins on the active layer which I can update with the new parameter values. This doesn't work if Layer Options> "Show/Snap/Modify Others" is set, as the active plugin may not be on the active layer. I have also not found a way of activating a parameter trigger for other selected plugins. ResetObject after SetRField only changes the active plugin.
-
Thanks r = o * sin(a) / (1 - sin(a)) worked perfectly. Find enclosed VW2025 file with script and screen grab arc offset.vwx arc offset.txt
-
I am struggling with the math needed to resolve an arc radius based on a known offset and an angle - see attached "resolve radius". This is a Marionette example I'm working on based on Deloitte University Asia Pacific China (but not exactly the same) https://archinect.com/firms/project/150042399/deloitte-university-asia-pacific-china/150459705 The junctions have linked panels with variable arc radii at each corner depending on a derived angle - see attached "deloitte connector" The offset above is from the centre of the bush connector to the edge of the arc radius. The derived radii (calculated in a node) will be applied to each vertex of an offset 2D poly path. Currently the node network uses a common radius for all panel edge corners. TIA
-
Got a bit weirder. My base system is VW 2020. The offending plugin was compiled (with code changes) successfully in VW2020 and transfered to VW2025 and worked perfectly on a newly created document. In the process of checking for 32K Vectorscript limit. I wonder if the limit also applies to $IMPORT files. I even tried setting/unsetting "Run scripts in developer mode". At least I have a method that seems to work. Converting to Python to avoid limit will be a big job though.
-
Thanks for responding. It compiles successfully (in a new file) when I hit the Test icon. It only fails on exit. I am currently checking for an erroneous error as I have made a code change but it was weird that it compiled OK in a file that contained an instance of the plugin in question. When it fails to compile in a new document and I try and create the plugin, initially I dont get any graphics and nothing is selected and the preference override dialog I have doesn't display (which is where the code errors) - only the standard preferences dialog. If I try a second time it creates the plugin correctly but I loose any widget buttons ie result := vsoAppendWidget (kWidgetButton, kABOUTBUTTON, 'About...', 0); Incidentally GetRField doesnt seem to work either. I need to double back and check my code changes in this particular plugin. All common include files seem to work with my other plugins. Apologies for the wild goose chase.
-
I have event based plugins which seems to fail to correctly compile at VW2024 and VW2025 because of errors with automatic P variables - see below. This is via Tools>Plugins>Plug-In Manager...>Edit Script - run following the creation of a new document. Had no problems from VW2020 to VW2023 with same code. I double checked the parameter name and whether there has been a change to case sensitive names. Incidentally, if an existing file contains an instance of the plugin then the compile works perfectly. Has anybody else had this problem. I suppose my back stop is to use GetRfield. I am running Windows 10 if that makes a difference. VW 2024 Update 7 (Build 772731) TIA
-
Thanks for the info. For a plugin, if I "Convert to Group", the attributes of the resultant group are not set "by Class" even though the plugin does have "by Class" set. Initially, the objects in the group have the correct class but not "by Class". Setting the group to "by Class" seems to work. I suspect that the shape (and possibly the nurbs path) used for the extrude along path do not have "by Class" set.
-
I have a number of plugins that internally create either an extrude along path or a simple extrude which don't seem to respect a viewports class override settings - see below. All objects should show up pink. I did a "Convert to Group" of a plugin and checked the class settings were OK and even did a convert to 3D polygons and still the class overrides weren't respected. I also created an extrude and extrude along path via VW commands which did respect viewport class overrides. Is there an object based setting I need to use to implement viewport class overrides? The calls used are ExtrudeAlongPath(pathH,shapeH) and BeginXtrd(extrfrom,extrto) There are calls to create a viewport with class overrides ie CreateVPClOvrd(viewportH,classname) but no object based setting. I wonder if I can get the parent of the plugin and if parent is a viewport get the class override setting and use in the plugin but this is a bit long winded.
-
SetTexMapReal Updating Values But Texture Not Changing
BillW replied to dhughes3's topic in Vectorscript
Thanks for reminding me. Just a note for others, for event enabled plugins, presumably the plugin option "Reset on Move" will need to be set. I haven't tried but I wonder if "PrepRelatedObjectForChange" might work but I doubt it. Generally, I have never successfully used this call (amongst a few other calls) -
SetTexMapReal Updating Values But Texture Not Changing
BillW replied to dhughes3's topic in Vectorscript
Has anyone found a way to update texture mapping settings. Tried all of above to no avail. Alternatively is there a way to invoke the "Update" button on the "Render" tab. Looks like "ExtrudeAlongPath" call sets Mapping type to "Perimeter" which has now changed (at VW 2022) to "Surface UV" when using "Extrude Along Path" menu command. I am thinking of using "auto align plane" and "follow longest edge" set using SetTexMapIntN(fsactlayer,3,0,1,0); {Plane} SetTexMapBoolN(fsactlayer,3,0,7,True); {auto align} SetTexMapBoolN(fsactlayer,3,0,5,True); {long edge} but have no way to invoke update. I note GetTexMapIntN(fsactlayer,3,0,1) returns 0 for both "Plane" and "Auto Align Plane" options. It would be nice if we could have an updated "ExtrudeAlongPath" call to handle all the options available in the "Extrude Along Path" menu command. I know we can use (from Marionette) eap = vs.CreateCustomObjectPath('Extrude Along Path', path, profile) vs.SetObjectVariableBoolean(eap, 1167, True) vs.SetRField(eap, 'Extrude Along Path', 'Fix Profile', 'No') but had problems in the past using this method. -
Thanks - it was a good exercise. The only thing I'm worried about is a conflict with another plugin using a texture part ID with the same number ie texPartID = 100 #custom partID I am assuming the texture part ID is global. Does anyone know how to find out if a texture part ID is already defined.
-
Finally got to grips with the problem of fully implementing textures for extrude along path plugins (at least I think). Seems to handle all texture options ie None, by Class and Texture. With multi path set, you can make a selection of both path1 and path2 texture parts and edit Mapping for both at the same time. Similarly, you can set a common texture for both. Find enclosed VW2024 plugin "Path Tool VWX FORUM" based on sandertb's version above. Added a multi path option as a proof of concept - see image below Any further information will be gratefully received. Thanks Path Tool VWX FORUM.vso
-
I've just reported vs.SetObjectTags omision as a bug.
- 9 replies
-
- python
- vectorscript
-
(and 2 more)
Tagged with:
-
Looks like SetObjectTags call is not implemented in Python (bug) - even though the call is available in Vectorscript. Sent DM to koenr.
- 9 replies
-
- python
- vectorscript
-
(and 2 more)
Tagged with: