# DomC

Member

515

2. ## use matrix

I think you are right. Even we do not ned to create a working plane to set the entity matrix which already can handle vectors instead angles. My bad is to look into the marionette SetEntityNode, which do not use vs.SetEntityMatrixN() There is no up and down. In my first example the edge symbol is inserted from bottom.
3. ## use matrix

Hello @MullingRJ I have several specific projects but this one would be on ice right now (As a saw the matrixes I had to joine the duscussion :-) and I think it is solvable but need some investigations to have a proper and elegant solution. I already have some code, which calculates points from edge of a 3D Path which a specific distance from the corners. What is needed not is a rotation vector which contains the rotation matrix related to the layer coordinate system. Thats how we insert symbols. I am pretty close to that by calculationg the x y z angle but i have not yet defined an algorithm to define if it is minus or plus angle. The code does not yet consoder, if i go up down left or right. But I am pretty sure, on our old math books there is a very compact and itelligent solution. So it would be great if you can join the project! Thanks @Simon. It is just "simple trigometric" but we have to check direction to if rotation is minus or plus or 180 - rotation. Without that, we have the direction of the plane but do not know from which side we look at the plane. What you see in the movie is, that I set the working plane which is defined with x, y, z, rotation. Then I place a symbol on that. That's what I want to do with the script. The plane of the corner is defined with the 3 points on the corner (i draw 3D locus to make it visible) "Just" left to solve to calculate the entity matrix from those 3 points on every corner. I alread have X Vector (p2, vorner_p) and Y Vector (corner_p - p3). z_vector also is defined through this two vectors I think. Now we need the rotation from that u' v' w' planen to the Layer coord plane. At the end we also could place objects on 3D planes very simple with a node, that creates a plane matrix (which can be used to SetEntityMatrix) from 3D points. That is something I think would help many users. We also maybe could draw a NURBS Surfaces and evaluate points on that with the vs-Commands. But always better to do that directly with math. Rotation matrix corner points.mp4 Fillet v2022.vwx
4. ## use matrix

The Matrix node just flatten the input vector tuples. (1,0,0),(0,1,0), (0,0,1), (0,0,0) ase example results in (1,0,0,0,0,1,0,0,1,0,0,0). I bet, this comment do not help you really 😀 I think it could be used to serve one of the other matrix nodes. to rotate as example a matrix. I am not an expert but try to explain: In computer-graphic, the "Eulerschen Winkel" (Formulas on the left) can be used to descripe the orientation of an object (A rotated coord system). Vectorworks uses this as example for planes, Entity Matrix etc. The Interesting point for me would be, how to get efficient such a matrix (which is just X rotation Angle, Y rotation Angle, Z rotation Angle and offset vector) as example from 3 points in space without using additional libraries (scypi, numpy etc.). I never tried this very intense but also would be interested in some explanations in this area. Something by script what we have with set working plane or automatic working plane. No function is provided for that as far as I can see.
5. ## 3D Fillet??

Thanks for input Larry and Pat. ConvertToNURBS can't put several segments together. If that is possible it would also not be needed to draw planar polylines and rotate them into the 3D Plane. I have corner points and control points already calculated and can directly draw a NURBS in 3D. It seems, that the hurdle is, that one segment of NURBS can only handle one type of vertex. Rounded vertex or edge vertex. every time we have an unrounded edge we have to create a new segment which we can't combine together. Minimum not in an easy way. What I also thought about is, that maybe the NURBS Curve with several NURBS internally is a different object as a single segment. What i maybe will try later: 1. Creating the object with different segments seems to be an attractive and proper solution. Also additionally the Level of detail for a fitting can be implemented here. 2. Menu Command compose making to work inside a Marionette PIO. But for that think I have to parent the Object on a layer then compose it and parent it back into the PIO. Which could work but is somehow ass-backward (Translation from "von hinten durch die Brust ins Auge" ?).

7. ## Data Tags

Oh, direct before my very eyes. Thank you so much, that works perfectly!
8. ## Data Tags

Hello Someone knows the secret of tagging an object with the DataTag by script? Seems to be not so easy. So far my researches: 1. Read the ASSKINDs of Object and DataTag. It shows me: 37 for the Data-Tag 36 for the Tagged Object obj1 = vs.FSActLayer() num = vs.GetNumAssociations(obj1) out_str = 'Associations\r' for i in range(num): v = str(vs.GetAssociation(obj1, i)) out_str += str(v)+'\r' vs.Message(out_str) 2. Further Assiciations obj1 = vs.FSActLayer() obj2 = vs.NextSObj(obj1) result = vs.AddAssociation(obj1, 17, obj2) #4(deleted if delete), 5(reset if deleted) 17(?) vs.HMove(obj1, 1,0) 3. Remove Associations obj1 = vs.FSActLayer() #stempel = vs.GetObject('stempel') num = vs.GetNumAssociations(obj1) out_str = 'Associations\r' for i in range(num): ioTargetObj, inKind, value = vs.GetAssociation(obj1, i) vs.RemoveAssociation(obj1, inKind, ioTargetObj) 4. Maybe with a constraint? h1 = vs.Handle(0) h2 = vs.GetObject('line1') h3 = vs.GetObject('symbol1') if h2 != vs.Handle(0): p2 = vs.Get2DPt(h2, 0) x1, y1 = vs.HCenter(h3) obj, index, containedObj = vs.GetClosestPt( h3, x1, y1) vs.AlrtDialog(str([obj, index, containedObj, h1, h2, h3])) #obj1 and h1 are the same contObj1 is None bool = vs.SetBinaryConstraint(1, h3, h2, index, -1, 1, -1, containedObj, 0) if h2 != vs.Handle(0) and h3 != vs.Handle(0): bool = vs.HasConstraint(h2) vs.AlrtDialog(str(bool)) This works for a line and a symbol. Maybe this works with data-tags and object also if we could find the right arguments.
9. ## VR panorama brighter than rendered image

The Rendering in VW Design Layer: Rendering in Viewport: (Rendering is a little brighter because of image effect) All is set to Renderstile "Moebel freistehend" Panorama Export Setting: Here the panorama export with the same renderstile: The Link to the panorama https://cloud.vectorworks.net/links/11ece6958ee3d58291a90e8843f6c72d/ How it would be used: This panorama is exported Renderworks but with a renderstile with a darker hdri. https://cloud.vectorworks.net/presentations/11ecc73b611af0e39a191233fa6cc30d/ File: https://cloud.vectorworks.net/links/11ece69bcd28bbdaaf4c0e8843f6c72d/
10. ## clock node?

Hello Also very interested in making visible the work of an algorithm. I think it is possible by script to show the Objects created or manipulated by script. But a Marionette saves the view before the script runs and recovers it. Somehow this results in a different behavior from Marionette compared to a python script. I played around with this some time ago. The Attached Document shows a script that contains the same code as a Marionette. By executing the script the movement of rectangle is plotted on the screen. Animation Test.mp4 For another example I putted every of the steps of the script on different layers. Then after the execution I batch-export the layers as pictures then combined into a movie with an external tool. Like this: I can't find that example anymore but I think i just hardcoded an Object creation and a vs.SetParent to put it on a new Layer Animation.vwx

Well done!
12. ## problem with list and filtering

Hi You can use the "Get Item" to get an element of a list. Input 0 to get first Item. So 10th Item you get with input 9.
13. ## and-node loses its function when used in red symbol and shared

This looks like, the symbol was edited last while the design-layer had another layer scale thank the layer scale of the actual active layer. Normally it helps co activate all, cut (cmd/ctrl. + X) and paste (cmd/ctrl + V). In this case it seems, the code attached to the add-node is broken. I can correct it as follows: 1. cut and paste 2. Double click and edit "less equal" and "greater equal" 3. Then the wires to the add node desapears and I reconnect again then it works. I think there is still an issue which can corrupt Marionette scripts. If you insert a red symbol on a design-layer which have a different layer scale than the layer scale was active while the symbol was created.
14. ## String Concatenate Issues

As the concat node is, it converts the input to a string and then loop the character and adds them. #inputs stringIn = str(self.Params.stringIn.value) #script newString = '' for s in stringIn: newString = newString + s #outputs self.Params.stringOut.value = newString I am not sure but I would expect from this node, it should do something like this: #inputs stringIn = self.Params.stringIn.value #script newString = '' for s in stringIn: newString = newString + str(s) #outputs self.Params.stringOut.value = newString
15. ## Get Text Properties from Parent PIO

Hi You want to attach a Text property on a Marionette Object and then inside the Script ask for the Text Properties attached to the Marionette PIO? I think if a Marionette Object can get some infos from the text menu, it would be possible. You can handle the Parent PIO, but I do not see, that a Marionette can get some text Infos by the text menu. You could get the class of the Parent PIO and the Text Style of the Class as a workaround maybe. But directly the Text Style I think works not with a Marionette Object Node. Here An example, if you get the text style of the parent PIO class. Side Note: First Time I use concat node, it seems to convert the input list to a string instead of concat the input strings, which is somehow not what I would expect. It converts the List in a string first ... TextStyleByPIO_class.vwx

17. ## Marionette - array / mirror / duplicate / rotate?

Hello Welcome to the Marionette Forum. I think your script looks quite good. My workflow is often to first calculate all necessary points and data. After That I create the Objects. Also I use a lot of custom nodes to save number of nodes (Enhanced Rectangle, Function 2, BBox Enhanced) but this is not necessary per se. Creating Rectangle to find the corner point is something I would not do generally. Also Mirroring is not necessary, if your feeds are circles or squares. To Mirror correctly you need one horizontal and one vertical axis. In your Script there is only one Axis. Also you need to mirror one Feed over a Diagonal Axis and if the shape is not a square, this had to be calculated. Or you Mirror at the Vertical Axis, then you mirror the resulting object along the horizontal axis. The Get Item in the Screenshot, gets the first second duplicate (top left) and mirror again along the vertical axis. By the way, mirroring should work like this: Mirror Example.vwx
18. ## Divide a nurbs curve and then draw lines, it appears only on 2D Sight

Hi Nice Example. You should use the 3D Poly. Ohne Titel 1.vwx
19. ## VW Installed Python Modules?

tkinter could be installed with the Marionette python Modul importer. But at the Moment this maybe also not work out of the box. And by using tkinter I had negative effects resp. some functions maybe additional code to make it run in an embedded python. Maybe off-topic. For Crossplatform Clipboard, this script could be used: import math import os import subprocess major, minor, maintenance, platform = vs.GetVersion() text = 'Hello World' def addToClipBoardWin(text): command = 'echo ' + text.strip() + ' | clip' os.system(command) def addToClipBoardMac(text): process = subprocess.Popen('pbcopy', env={'LANG': 'en_US.UTF-8'}, stdin=subprocess.PIPE) process.communicate(text.encode('utf-8')) if platform == 1: addToClipBoardMac(str(text)) else: addToClipBoardWin(str(text))
20. ## vs.CallTool SP3

That little test works here. It seems the nested callback of the wiki-example is a little bit too ambitious. vs.DSelectAll() def resultCallback1(): h1 = vs.FSActLayer() vs.DSelectAll() p1 = vs.GetSegPt1(h1) p2 = vs.GetSegPt2(h1) vs.Locus(p1) vs.Locus(p2) vs.CallTool(-201, resultCallback1)
21. ## vs.CallTool SP3

Hi I just stumpled over that here: https://developer.vectorworks.net/index.php/VS:CallTool It seems, that CallTool is able to server a callback function. It is satisfying great to see every step of better python interaction with Vectorworks. Unfortunately it seems, that the example code on the developer Wiki does not work here. Anybody tried something already which is using that callback feature?
22. ## vs.ForEachObject seems slow

Hello I think the issue with the script that makes it slow is, that you loop the light devices and in that loop you give a search-request with ForEachObject. If you have many objects in your drawing a search-request over all objects in the Drawing could take maybe one second and if you have that 250 times in a loop it will take 250 seconds as example. The better way in my opinion 1. Use ForEachObject just once on all Objects that could be your target light objects () 2. Then loop all light devices from data (as you do) 3. Then do it as following: if (isAvailable): lights = [] #name, handle def get_lights(h): n = vs.GetName(h) lights.append([n,h]) c = "((PON='Lighting Device'))" vs.ForEachObject(get_lights, c) for p in data['LightingDevices']: uid = p['__UID'] for light_name, h in lights: #loop through the found light objects in the drawing if light_name == uid: instrType = p['instrumentType'] instrMode = p['fixtureMode'] wattage = p['wattage'] weight = p['weight'] position = p['position'] purpose = p['purpose'] channel = p['channel'] unitNumber = p['unitNumber'] universeAdress = p['patch'] circuitNumber = p['circuitNumber'] circuitName = p['circuitName'] dmxLine = p['dmxLine'] dmxFootprint = p['dmxFootprint'] deviceType = p['deviceType'] color = p['color'] template1 = p['template1'] template2 = p['template2'] user1 = p['userField1'] user2 = p['userField2'] user3 = p['userField3'] user4 = p['userField4'] user5 = p['userField5'] user6 = p['userField6'] className = p["class"] eachLight(h) The loop in loop will be very fast. Much faster then the search-request (ForEach ...) inside a loop. Untested code but I bet a beer this would do the job faster
23. ## Popup- value for true/false

Hi It should be possible, to use the "Attributes"-Node to set fill pattern to 0. Connect it after your object and set it to Empty Fill. After That attach your colors. The Problem could be that the "Attributes" node replace also the line weight and line style. If that is a problem you can use the "function"-Node. And just paste vs.SetFPat(x, 0) in the input field.
24. ## PEMB (Pre-Engineered Metal Building) Bent

Hi I think this object is between 2-40 hours to create. So I post without taking the order. It depends on which level of Detail you really need (Material Thickness , drillings for screws etc.) I can give you or somebody else a start-assist and a possible workflow. A sketch, what pitch, height, span, base size exactly means were nice because it is a big part of the work to specificate exactly which values should be variable. It is about the work of 3 hours (but always the first 60% from something are done very fast. It would be enough if you do not need any screws and if the material thickness on all edges would be the same and if you need just the hull of the material not the single parts and how they exactly cutted in raw form (miter etc)). Once more I ask myself, how it is possible to create exact Elements by using the non-metric-unit-system (just a gloss a place whenever I have the chance :-) BENT_v1.vwx
25. ## Wrapper to Object Node Problem

Hi Marionette has his own function to deside (and with that if it should use a 3D Move, 3D Rotate or 2D Move, 2D Rotate etc.) if an object is planar or not. This concept has some limitations. If you edit the code to this, the rotate node will work inside the PIO. Double click the node and delete the first line, then you can edit the code. #planar = Marionette.Is2DObject(obj) cx = center[0] - offset[0] cy = center[1] - offset[1] cz = center[2] - offset[2] #if planar: vs.HRotate(obj, (cx, cy), r[2]) #else: # vs.Set3DRot(obj, r[0], r[1], r[2], cx, cy, cz) In this case, the Rotate-Node deside, that it wants to use the vs.Set3DRot() command to the symbol. which seems to work, if the symbols are on the layer. Inside the PIO it does not work. But this will not work, if the symbols are on screen plan. Inside the PIO the symbols are placed on a screen-plane like place (top plan view). I think it is related to the different plane- and container-concepts that makes it very frittered and hard for one node to handle.
×

• KBASE
• #### MARIONETTE

×
• Create New...