Jump to content

KingChaos

Member
  • Posts

    39
  • Joined

  • Last visited

Reputation

0 Neutral

1 Follower

Personal Information

  • Location
    Germany

Recent Profile Visitors

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

  1. Is here anyone, who ever copied a pythoncode into a script in VW to use it in the BOM charts?
  2. does someone knows, what of the code the wrapped marionette i have to copy into my script editor? import Marionette import math import operator Marionette.execution_mode = Marionette.ExecutionType.Export ###################### IfInStringABS_Wrap_79 ######################### class IfInStringABS_Wrap_79: Handle = vs.Mrntte_GetNodeHandle(79) @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): this = Marionette.Node("Wrapper") this.SetDescription("""Wrapper""") this.SetLinksObjects() InputKante_60_Lifted = Marionette.OIPControl( 'InputKante', Marionette.WidgetType.Int, 134) InputKante_60_Lifted.SetDescription("An OIP control that accepts integer values") KantenNr_61_Lifted = Marionette.OIPControl( 'KantenNr', Marionette.WidgetType.Int, 2) KantenNr_61_Lifted.SetDescription("An OIP control that accepts integer values") ABS_Output = Marionette.PortOut() ABS_Output.SetDescription("The result item") def RunNode(self): ###################### String_62 ######################### class String_62: Handle = vs.Mrntte_GetNodeHandle(62) #COMMAND;READONLYREFFILE;[VWLibDef]/Input\String.py; #Modified April 2017 @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): #APPEARANCE #Name this = Marionette.Node( 'String' ) this.SetDescription('A text string defined in the OIP') #Input Ports #OIP Controls String = Marionette.OIPControl( 'string', Marionette.WidgetType.Text, '') String.SetDescription('A text string') #Output Ports s = Marionette.PortOut() s.SetDescription('The string') #BEHAVIOR def RunNode(self): #inputs s = self.Params.String.value #script #outputs self.Params.s.value = s ###################### String_89 ######################### class String_89: Handle = vs.Mrntte_GetNodeHandle(89) #COMMAND;READONLYREFFILE;[VWLibDef]/Input\String.py; #Modified April 2017 @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): #APPEARANCE #Name this = Marionette.Node( 'String' ) this.SetDescription('A text string defined in the OIP') #Input Ports #OIP Controls String = Marionette.OIPControl( 'string', Marionette.WidgetType.Text, '') String.SetDescription('A text string') #Output Ports s = Marionette.PortOut() s.SetDescription('The string') #BEHAVIOR def RunNode(self): #inputs s = self.Params.String.value #script #outputs self.Params.s.value = s ###################### InputKante_60 ######################### class InputKante_60: Handle = vs.Mrntte_GetNodeHandle(60) #COMMAND;READONLYREFFILE;[VWLibDef]/Input\Int.py; #Modified April 2017 @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): #APPEARANCE #Name this = Marionette.Node( 'Int' ) this.SetDescription('An integer value') #Input Ports #OIP Controls Int = Marionette.OIPControl( 'Integer', Marionette.WidgetType.Int, 0) Int.SetDescription('An OIP control that accepts integer values') #Output Ports i = Marionette.PortOut() i.SetDescription('The value') #BEHAVIOR def RunNode(self): #inputs i = self.Params.Int.value #script #outputs self.Params.i.value = i ###################### KantenNr_61 ######################### class KantenNr_61: Handle = vs.Mrntte_GetNodeHandle(61) #COMMAND;READONLYREFFILE;[VWLibDef]/Input\Int.py; #Modified April 2017 @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): #APPEARANCE #Name this = Marionette.Node( 'Int' ) this.SetDescription('An integer value') #Input Ports #OIP Controls Int = Marionette.OIPControl( 'Integer', Marionette.WidgetType.Int, 0) Int.SetDescription('An OIP control that accepts integer values') #Output Ports i = Marionette.PortOut() i.SetDescription('The value') #BEHAVIOR def RunNode(self): #inputs i = self.Params.Int.value #script #outputs self.Params.i.value = i ###################### If_In_String_70 ######################### class If_In_String_70: Handle = vs.Mrntte_GetNodeHandle(70) #COMMAND;READONLYREFFILE;[VWLibDef]/String\If In String.py; #added to library 02/28/2018 MFarrell @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): #APPEARANCE #Name this = Marionette.Node( 'If In String' ) this.SetDescription( 'If a sub string exists in the given full string, this node returns True, if not, it returns False.' ) #Input Ports sFull = Marionette.PortIn( '' ) sFull.SetDescription( 'The full string to search' ) sSub = Marionette.PortIn( '' ) sSub.SetDescription( 'The sub string' ) #OIP Controls #Output Ports b = Marionette.PortOut() b.SetDescription( 'True or False, depending on whether the sub string is in the full string' ) #BEHAVIOR def RunNode(self): #inputs full = self.Params.sFull.value sub = self.Params.sSub.value #script bool = [] if str(sub) in str(full): bool.append(True) else: bool.append(False) #outputs self.Params.b.value = bool ###################### ABS_Output_83 ######################### class ABS_Output_83: Handle = vs.Mrntte_GetNodeHandle(83) #COMMAND;READONLYREFFILE;[VWLibDef]/Data Flow\If.py; #Modified by MFarrell May 2017 @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): #APPEARANCE #Name this = Marionette.Node( 'If' ) this.SetDescription( 'If test is true, pass the value from true otherwise pass the value from false' ) #Input Ports true = Marionette.PortIn( None, 'itemTrue' ) true.SetDescription( "An item" ) false = Marionette.PortIn( None, 'itemFalse' ) false.SetDescription( "An item" ) test = Marionette.PortIn( True, 'bTest' ) test.SetDescription( "A boolean value" ) #OIP Controls #Output Ports out = Marionette.PortOut('item') out.SetDescription( "The result item" ) #BEHAVIOR def RunNode(self): #inputs test = self.Params.test.value true = self.Params.true.value false = self.Params.false.value #script if test: out = true else: out = false #outputs self.Params.out.value = out if Marionette.execution_mode != Marionette.ExecutionType.PIOExecute: vs.BeginGroup() String_62.Params.String.value = """ABS""" String_62.Params.s.SetConnected( True ) if String_62.Params.this.initFunc: String_62.Params.this.initFunc(String_62) String_62.RunNode(String_62) ABS_Output_83.Params.true.value = Marionette.OutputMerge( ABS_Output_83.Params.true.value, String_62.Params.s ) ABS_Output_83.Params.true.blocked = ABS_Output_83.Params.true.blocked or String_62.Params.s.blocked if String_62.Params.this.finalFunc: String_62.Params.this.finalFunc(String_62) Marionette.NotifyForOutValue( String_62, 0, String_62.Params.s ) ######################################################################### String_89.Params.String.value = """ """ String_89.Params.s.SetConnected( True ) if String_89.Params.this.initFunc: String_89.Params.this.initFunc(String_89) String_89.RunNode(String_89) ABS_Output_83.Params.false.value = Marionette.OutputMerge( ABS_Output_83.Params.false.value, String_89.Params.s ) ABS_Output_83.Params.false.blocked = ABS_Output_83.Params.false.blocked or String_89.Params.s.blocked if String_89.Params.this.finalFunc: String_89.Params.this.finalFunc(String_89) Marionette.NotifyForOutValue( String_89, 0, String_89.Params.s ) ######################################################################### InputKante_60.Params.i.SetConnected( True ) if InputKante_60.Params.this.initFunc: InputKante_60.Params.this.initFunc(InputKante_60) InputKante_60.Params.Int.value = self.Params.InputKante_60_Lifted.value InputKante_60.RunNode(InputKante_60) If_In_String_70.Params.sFull.value = Marionette.OutputMerge( If_In_String_70.Params.sFull.value, InputKante_60.Params.i ) If_In_String_70.Params.sFull.blocked = If_In_String_70.Params.sFull.blocked or InputKante_60.Params.i.blocked if InputKante_60.Params.this.finalFunc: InputKante_60.Params.this.finalFunc(InputKante_60) Marionette.NotifyForOutValue( InputKante_60, 0, InputKante_60.Params.i ) ######################################################################### KantenNr_61.Params.i.SetConnected( True ) if KantenNr_61.Params.this.initFunc: KantenNr_61.Params.this.initFunc(KantenNr_61) KantenNr_61.Params.Int.value = self.Params.KantenNr_61_Lifted.value KantenNr_61.RunNode(KantenNr_61) If_In_String_70.Params.sSub.value = Marionette.OutputMerge( If_In_String_70.Params.sSub.value, KantenNr_61.Params.i ) If_In_String_70.Params.sSub.blocked = If_In_String_70.Params.sSub.blocked or KantenNr_61.Params.i.blocked if KantenNr_61.Params.this.finalFunc: KantenNr_61.Params.this.finalFunc(KantenNr_61) Marionette.NotifyForOutValue( KantenNr_61, 0, KantenNr_61.Params.i ) ######################################################################### if not If_In_String_70.Params.sFull.blocked and not If_In_String_70.Params.sSub.blocked: If_In_String_70.Params.sFull.SetConnected( True ) If_In_String_70.Params.sSub.SetConnected( True ) If_In_String_70.Params.b.SetConnected( True ) if If_In_String_70.Params.this.initFunc: If_In_String_70.Params.this.initFunc(If_In_String_70) maxPCnt = 0 maxPCnt = If_In_String_70.Params.sFull.MaxLen( maxPCnt ) maxPCnt = If_In_String_70.Params.sSub.MaxLen( maxPCnt ) if If_In_String_70.Params.this.nodeListAbsorb or maxPCnt == 0: try: If_In_String_70.RunNode(If_In_String_70) except: Marionette.ReportException() ABS_Output_83.Params.test.value = Marionette.OutputMerge( ABS_Output_83.Params.test.value, If_In_String_70.Params.b ) ABS_Output_83.Params.test.blocked = ABS_Output_83.Params.test.blocked or If_In_String_70.Params.b.blocked else: p0List = If_In_String_70.Params.sFull.ExtendList( maxPCnt ) p1List = If_In_String_70.Params.sSub.ExtendList( maxPCnt ) out0 = None out0blocked = False for p0, p1 in zip(p0List, p1List): If_In_String_70.Params.sFull.value = p0 If_In_String_70.Params.sSub.value = p1 try: If_In_String_70.RunNode(If_In_String_70) except: Marionette.ReportException() out0 = Marionette.OutputMerge( out0, If_In_String_70.Params.b ) out0blocked = out0blocked or If_In_String_70.Params.b.blocked If_In_String_70.Params.b.SetValue( out0 ) If_In_String_70.Params.b.blocked = out0blocked ABS_Output_83.Params.test.value = Marionette.OutputMerge( ABS_Output_83.Params.test.value, If_In_String_70.Params.b ) ABS_Output_83.Params.test.blocked = ABS_Output_83.Params.test.blocked or If_In_String_70.Params.b.blocked if If_In_String_70.Params.this.finalFunc: If_In_String_70.Params.this.finalFunc(If_In_String_70) else: If_In_String_70.Params.b.blocked = True ABS_Output_83.Params.test.value = Marionette.OutputMerge( ABS_Output_83.Params.test.value, If_In_String_70.Params.b ) ABS_Output_83.Params.test.blocked = True Marionette.NotifyForOutValue( If_In_String_70, 0, If_In_String_70.Params.b ) ######################################################################### if not ABS_Output_83.Params.true.blocked and not ABS_Output_83.Params.false.blocked and not ABS_Output_83.Params.test.blocked: ABS_Output_83.Params.true.SetConnected( True ) ABS_Output_83.Params.false.SetConnected( True ) ABS_Output_83.Params.test.SetConnected( True ) if ABS_Output_83.Params.this.initFunc: ABS_Output_83.Params.this.initFunc(ABS_Output_83) maxPCnt = 0 maxPCnt = ABS_Output_83.Params.true.MaxLen( maxPCnt ) maxPCnt = ABS_Output_83.Params.false.MaxLen( maxPCnt ) maxPCnt = ABS_Output_83.Params.test.MaxLen( maxPCnt ) if ABS_Output_83.Params.this.nodeListAbsorb or maxPCnt == 0: try: ABS_Output_83.RunNode(ABS_Output_83) except: Marionette.ReportException() else: p0List = ABS_Output_83.Params.true.ExtendList( maxPCnt ) p1List = ABS_Output_83.Params.false.ExtendList( maxPCnt ) p2List = ABS_Output_83.Params.test.ExtendList( maxPCnt ) out0 = None out0blocked = False for p0, p1, p2 in zip(p0List, p1List, p2List): ABS_Output_83.Params.true.value = p0 ABS_Output_83.Params.false.value = p1 ABS_Output_83.Params.test.value = p2 try: ABS_Output_83.RunNode(ABS_Output_83) except: Marionette.ReportException() out0 = Marionette.OutputMerge( out0, ABS_Output_83.Params.out ) out0blocked = out0blocked or ABS_Output_83.Params.out.blocked ABS_Output_83.Params.out.SetValue( out0 ) ABS_Output_83.Params.out.blocked = out0blocked if ABS_Output_83.Params.this.finalFunc: ABS_Output_83.Params.this.finalFunc(ABS_Output_83) else: ABS_Output_83.Params.out.blocked = True Marionette.NotifyForOutValue( ABS_Output_83, 0, ABS_Output_83.Params.out ) ######################################################################### self.Params.ABS_Output.SetValue( ABS_Output_83.Params.out.value ) self.Params.ABS_Output.blocked = ABS_Output_83.Params.out.blocked if Marionette.execution_mode != Marionette.ExecutionType.PIOExecute: vs.EndGroup() try: ################################################# IfInStringABS_Wrap_79.Params.InputKante_60_Lifted.value = 134 IfInStringABS_Wrap_79.Params.KantenNr_61_Lifted.value = 2 if Marionette.execution_mode != Marionette.ExecutionType.PIOExecute and IfInStringABS_Wrap_79.Params.this.nodeLinksObjects: vs.BeginGroup() if IfInStringABS_Wrap_79.Params.this.initFunc: IfInStringABS_Wrap_79.Params.this.initFunc(IfInStringABS_Wrap_79) IfInStringABS_Wrap_79.RunNode(IfInStringABS_Wrap_79) if IfInStringABS_Wrap_79.Params.this.finalFunc: IfInStringABS_Wrap_79.Params.this.finalFunc(IfInStringABS_Wrap_79) if Marionette.execution_mode != Marionette.ExecutionType.PIOExecute and IfInStringABS_Wrap_79.Params.this.nodeLinksObjects: vs.EndGroup() if Marionette.execution_mode != Marionette.ExecutionType.Export: vs.Marionette_LinkObject(IfInStringABS_Wrap_79.Handle, vs.LNewObj()) Marionette.NotifyForOutValue( IfInStringABS_Wrap_79, 0, IfInStringABS_Wrap_79.Params.ABS_Output ) ######################################################################### except Marionette.MarionetteError: pass
  3. but what now? i need this as a script for running it in the chart of my vw-BOM
  4. Hi, i am trying to convert a number from 1-4 digits into a predefined text. Input is this "1 to 4" digit-number, which can be a and an single-digit (1,2,3 or 4) which has to be compared whether the single digit is contained in the 4 digit. The script has to return a string "ABS" if the input is: 1234 & 1 -> ABS 1 is included 234 & 1 -> "" 1 is not included 312 & 1 -> ABS i dont know which node i have to use. I searched for some who splits the 4 digit into 4 single digits, but i cant find it. This Script i have to use in a bom-Chart for interiorcad. I would rather use the excel functions, but this function does not work in the vw chart i think or i am not able to find the syntax i have to use. If someone can tell me, how the syntax of this function is, i dont need the marionette. BR KC
  5. If U want to make such parametric stuff in a few minutes try topsolid. In Case U want to produce your 3d stuff on cnc machines, U need years for each Module with vw. BR kc
  6. KingChaos

    Input data

    Why U want to Put it into a seperated Mask?
  7. Are there interiorcad nodes existing?
  8. I did not found the node for placing part3d of interiorcad. U know where it is or how ist IS named? What U would do instead of sorting Them ans get the surface boundary for making Part 3d? The task is, Putting existing geometry on the CNC machine. Before i Started this Job i could Not Imagine, that with vektorworks it is so complicated Putting imported 3d geometrY Into CNC Code and i never thought that unparametrical modelling exists. Thx so far Then. Maybe i will get an additional different Software for me to do the stuff VW cant do.
  9. Hi Marionettes 🙂 is it possible to get some Marionette which does the stuff in the title? I can´t do this by Hand, because there are app. hundreds of pieces from a parasolid file (which are non ineriorcad 3D-parts) and i Need to get them onto my machine. So i Need to "extract" the Surface (out of the modelling tools) and turn the Output (poly) into a 3D-part. By hand this is really slow and annoying, if u got hundreds of solids u have to machine. So i think, if i can imagine a Marionette, which , sort them by thickness, rotate them all in the following way-> that the Main-Surface of the pieces are in the same "Level Z=0" then get the "extract tool" of the top Surface into a poly and made 3D-Parts for interior cad. (the last step is possible to do it manually, because i can select multiple polys and using the flash-tool-3D-part for making multiple 3D-parts with one click) BR KC PS: applying the Name of the parasolid-volumes onto the polys or the 3D parts (if it is poss to make this 3D-part-interiorcad command by marionette) would be a nice plus.
  10. What ist the difference between Plugin and Plugin symbol? The German Translation often varies ^^
  11. How U learned to use and create those Plugins?
  12. At First i have to translate yOur answer, all the Makro names differ German language. Thx a Lot. Maybe you misunderstand me while i am using wrong Translation. I SAW a YouTube movie where Lisa did some Volume subtraction with Marionette
  13. What does that means? Is it possible to use the 3D-part Interiorcad in a Marionette or not? Is there any tutorial for implementing it into Marionette? br KC
  14. I need Input to Draw Something Like the assembly in the Pictures in the Attachment with just drawin a polyLine. Drawing polyline and waiting the Counter get Drawn by itself. This was Made by me with topsolid Wood. IT iS ready for Rendering AND machining after i Made the polyline and fully parametrical dir adjusting all you have to adjust. I used App. 100 Parameters and the deepest structure gots 8 sublevels of assemblies. IT took me a few month but IT contains dozents of subvariants and different Fronts and Glasssystems. So the Sales people can offer the stuff right at their First Meeting with the customer. Even the cleaning Personal could Draw a Counter with that Tool. I Hope i dont cry, If i cant code it with VW. 😉
×
×
  • Create New...