Jump to content
Developer Wiki and Function Reference Links ×

scipt from marionette?


KingChaos

Recommended Posts

3 hours ago, KingChaos said:

Now i need to know, how i can make a symbol out of it with OIP parameter ports.

 

Place your PIO in the drawing. Select it. Open menu Modify > Create Symbol..., name your symbol, and check the items circled in red. This creates a RED Symbol, which places a copy of your PIO in the drawing when you place the symbol. Your parameters will show in the OIP

 

CreateSymbolDialog.jpg.4bfb939b16c2c3f0c530c3ff64279a30.jpg

 

Raymond

 

Create Symbol Dialog.pdf

Edited by MullinRJ
Link to comment
11 hours ago, MullinRJ said:

If I was going to script my solid, I would probably use SubtractSolid() to make a shell. There is also the Shell Solid Tool, if you are drawing manually.

yeah this is how my marionette for metal parts works. except the miterdatabaserecord all is working properly.

 

i made Solid for the drillings (cylinders and or cones) and for the endmiter and subtract them.

 

to reduce the number of nodes i sketched each cross section with a 2D geometry and use this to extrude and subtract.

 

 

But now i want a new approach.

 

@ Jesse: i USED this point object, only the icon was of tool 🙂

 

image.png.bb6ff50d5560e2a9ef4de827181872de.png

now i ask myself, wether a path extrude works like the wall plugin from vwx.

 

image.png.9d2c28c10442b22596510720079d74a7.png

i could use it later for my masterplan.

 

can u specify what difference i from point to rectangle and what malus (oddities) u spoke about?

QRX V11_clean.vwx

Link to comment
8 minutes ago, KingChaos said:

can u specify what difference i from point to rectangle and what malus (oddities) u spoke about?

The biggest thing is that it doesn't work like the rectangle tool where you draw based on opposite corners, instead you click to once to start the rectangle, then click to set the width, then click to set the height, either by moving out from the center of the object or from the top/bottom depending on what's set in the mode bar.

 

I personally find them clunky and dislike the extra click, so I only use them in instances where being able to use resize handles is handy or necessary.  When I do, I usually write a Tool using GetRect to get the dimensions, then script out placing the Plug-in Object itself so that the user never has to use the awkward extra click method.  But generally, most of my plug-ins that are rectangle shaped want to have very specific dimensions that are better to be typed in to the OIP rather than interactively sized, so point objects are the way to go.

 

One other oddity is that the origin point for Rectangle PIOs is locked to one side of the X dimension (depending on which way the user goes after setting the first point), and center of the object on the Y dimension.  With a Point PIO, you can basically make the origin anywhere you want.  Based on what I've seen you building, my guess is that you would want the XY origin to be the center of the tube, which would not be possible with a Rectangle PIO.

  • Like 1
Link to comment

 

 

ah ok, my english is not best but i think i got it now.

 

Can you tell me some hints for the "3D-Pfadobject", this is what i need for a very cool tool.

 

I want to let the user sketch a polyline (only lines no arcs) and behind this a sales counter/cabniets will appear in seperate modules (in red symbols). Then we can apply cabinets on the whole wall with 1 polyline for purchaseinformation about the chipboards and fittings in a few seconds and for rendering if u need a fast cheating-fassade of cabinets just to make some renderpics for the customer.

 

Like you see here i do it with topsolid (mov1).

 

i made it with a marionette with a control geometry. But its not working 100% until the extragroup will implement dowels and screws in the backwall of the cabinet. 99 % of all carpenters use "medium-density fiberboardAE" with notches as a backwall. But Store construction cabinets use allways 19 mm chipboards witch u cant nutch. When i apply some dowels and screws outside the cabinet container of interiorcad the symbol will turn blue and the parametric is lost.

 

I THINK THAT, Only if all the the cabinetparts 100 % intern jointed/connencted i will have a red symbol and can modify the databaseentries (length, width and height). But this wont take more then 1 upgrade then 2024 i think it could be realised in 2025.

 

I want to be ready if this will come.

 

in the videos u see, that is a polyline, and i can apply some cabinets behind it. If i change the poly, all cabinets are following.

This works not so bad a i described, but only with cabintets without dowels and screws.

 

the marionette was not so complicated but has some oddities too. Each cabinetsymbol must be different (in the ress. manager), because of the naming of the cabinets and cabinet parts. Therefore computerworks gave me this hint, to use the command.

 

VS:DoMenuTextByName - Vectorworks Developer

 

It should start the "namingprocess" which automatically ran, if u copy a cabinet with strg+mouse1. Else i have several 3DParts vom Interiorcad with the same name and then the databaseconnection is lost on all except one part.

 

In VWX my "path extrude" projects looks like this, 3 years passed since then

 

(mov 2).

 

Now i have some capacity to put it on a new lvl, why not with 3D-Path-Extrude Plugin?

 

br KC

Link to comment

Hello @KingChaos,

  To give you an appropriate answer I need to know how your PIO is supposed to work. If you just draw a path and something happens, the PIO is relatively simple. However, if you you want to have controls showing in the OIP, like one or more buttons, checkboxes, radio buttons, popup menus, etc., then you will want an Event-Enabled PIO, and that is not a simple thing to describe. 

 

   If you would, please describe how you want the PIO to work – what you will draw, what actions you want perform on the object after it's drawn, etc. The more detail you provide the easier it will be for me (us) to be specific.

 

Thank you,

Raymond

Link to comment

it will take pages ^^ if i start now for all functions. okay, i see it will take some time.

 

for the first, i want to have for each segment a red symbol placed (3D-cabinet of Extragroups Interiorcad) and a popup for each segment where i can select a symbol which is placed. 🙂

Link to comment

I am still struggling with what you want the plug-in to do.  Do you want it to stay a path object, so as you manipulate it, the PIOs from the red symbols follow the path or is the path just for initially placing a group of red symbols?  If you don't need the path after object creation, you can achieve what you are looking for using a Tool plug-in instead.

 

If you do need to keep the path, you will use GetCustomObjectInfo to get a handle to your Plug-in Object, then feed that handle into GetCustomObjectPath to load the path into a handle.  Then you'll use a FOR loop with GetVertNum and GetPolyPt3D to get to location of each vertex.

 

Basic code for handling the path would look like this:

 

PROCEDURE ExampleTest;

VAR

	objHd,recHd,wallHd,pathHd:HANDLE;
	objName:STRING;
	numVerts,i:INTEGER;
	verts:DYNARRAY[] OF POINT3D;

BEGIN
	IF GetCustomObjectInfo(objName,objHd,recHd,wallHd) THEN pathHd:=GetCustomObjectPath(objHd);
	
	numVerts:=GetVertNum(pathHd);
	ALLOCATE verts[1..numVerts];
	
	FOR i:=1 TO numVerts DO GetPolyPt3D(pathHd,i,verts[i].x,verts[i].y,verts[i].z);
END;

Run(ExampleTest);

 

This code stores all of the vertices of the path object into an array of 3D points.  What you do with them from there is up to you.

 

Link to comment
22 hours ago, KingChaos said:

can you pls help with the minimal code is needed for a 3d pathobject? The height ob the object will be the length between the 2 clicks i guess?

 

18 hours ago, KingChaos said:

it will take pages ^^ if i start now for all functions. okay, i see it will take some time.

 

 

Hello @KingChaos,

   Without knowing more specifically what you want to achieve I can only give a basic response to your question.

 

   What I'm expecting from you is a description that you might give a scripting professional that you hired to do the work as you outline it.

As an example (not reflecting your actual intentions):

1) Draw a 3D Polygon.

2) Use the center of polygon sides to create "extrudes".

3) Use "Depth" field in OIP to set extrude's depth.

4) Use "Extrude" field in OIP to set extrude's height.

5) Have a Button in OIP to save each extrude to a symbol and name it uniquely. (optional)

6) Have a Button in OIP to build Worksheet takeoffs from PIO. (optional)

7) Use Popup menu in OIP to apply Texture(s). (optional)

 

   The more detail you supply about each functional step you want, the better. Knowing how your OIP is supposed to be used to control your object will help us suggest what we would recommend you try.

 

   In a thread from December 2022 I posted a basic outline of the code needed for an Event-Enabled-PIO. This won't solve your problem, but it will show you what the outline of an event-enabled Plug-In might look like. Your specific code would need to be inserted into this shell to make it do anything useful. Here's the link:

https://forum.vectorworks.net/index.php?/topic/103538-event-enabled-plugins-with-variable-number-of-parameters/#comment-452032

 

Raymond

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...