Jump to content
Developer Wiki and Function Reference Links ×

spreadsheet-driven Popups in VW


KingChaos

Recommended Posts

Hi there,

 

I am genereting some parametrical steel/alu/stainless steel parts with database entries with "sales info".

 

to ensure our draftsmen can only use restricted material AND sizes of this material (in this case metalworks -> stainless steel, crude steel, steel sheets etc  ) i need some kind of popup, which is driven by some chart, where i can input the suppliers materials & dimensions.

 

The user has to pick out of a popup:

1. kind of Material (sheet, L profil, T profil, rect. tubes, circle tubes ) -> we only have 1 supplier he can supply the lists out of his "shopping cart"

2. the dimension (w,t,l)

3. Coating/finishing

 

manuel input has to be:

4. Name of the part

5. information

 

4 & 5 must get into the database "Schlosserei - Bauteilinfo" in the fields.

 

For now i am seeking a way to put exceldata into a VW chart which drives the popup names and parameters.

 

Later on will need some additional help.

 

Some stuff is working well, maybe with too complicated nodes, but i think its working.

 

In the end i think i need a profilesymbol with a polyline for each profile we use and the popup 1. will pick this symbol and then extruded into the length needed.

 

 

But the 1. step is too hard for me too take it alone, maybe someone knows what i am planning and can help me with the popups.

 

br KC

 

 

Link to comment

Now i proceed with the database stuff und now i THINK I HAVE to Edit the Node "Custom Popup" in such a way,

 

that i have the:

 

- "choice 1" made out of "Cell A2-A5" in my spreadsheet "Stammdaten Handelshof Materialauswahl"

- "Choice 2" made out of the Cell in Column M (dimension) in my spreadsheet "Stammdaten Handelshof Rechteckrohr" where Column G (material type) has the same value als Coice 1.

 

Is there any way to do this so or different?

 

#DomC
@Marionette.NodeDefinition
class Params(metaclass = Marionette.OrderedClass):
#APPEARANCE
    #Name
    this = Marionette.Node( "Custom Pulldown" )
    this.SetDescription( 'A Dialog with 3 Popups')
    #Input Ports
    sDialog = Marionette.PortIn('Dialog Name')
    sTitle1 = Marionette.PortIn('Materialtyp:')
    lPopup1 = Marionette.PortIn([],'{Stammdaten Handelshof Materialauswahl->A2:A5}')
    sTitle2 = Marionette.PortIn('Querschnitt:')
    lPopup2 = Marionette.PortIn([],'choice2')
    sTitle3 = Marionette.PortIn('Title 3:')
    lPopup3 = Marionette.PortIn([],'choice3')
    iWidth = Marionette.PortIn(40)
    
    #OIP Controls
    text = Marionette.OIPControl( 'Text', Marionette.WidgetType.Text, '')
    text.SetDescription( 'Dialog user prompt string' )
    
    #Output Ports
    sPopup1 = Marionette.PortOut()
    sPopup2 = Marionette.PortOut()
    sPopup3 = Marionette.PortOut()
    sPopup1.SetDescription( 'The Result of the Popups' )
    

    
#BEHAVIOR
    this.SetListAbsorb()

def RunNode(self):
    #inputs
    DialogName = self.Params.sDialog.value[0]
    title1 = self.Params.sTitle1.value[0]
    title2 = self.Params.sTitle2.value[0]
    title3 = self.Params.sTitle3.value[0]
    
    pop1 = self.Params.lPopup1.value
    pop2 = self.Params.lPopup2.value
    pop3 = self.Params.lPopup3.value
    width = self.Params.iWidth.value[0]

    numPopups = 3
    #script

    def Dialog_Handler(item, data):
        
        
        for i in range(len(pop1)):
            vs.AddChoice( self.dialog, 11, pop1[i], i+1 )
        
        for i in range(len(pop2)):
            vs.AddChoice( self.dialog, 12, pop2[i], i+len(pop1)+1 )

        for i in range(len(pop3)):
            vs.AddChoice( self.dialog, 13, pop3[i], i+len(pop2)+1 )
                            

        self.v1 = vs.GetItemText( self.dialog, 11 )
        
        self.v2 = vs.GetItemText( self.dialog, 12 )
        self.v3 = vs.GetItemText( self.dialog, 13 )
        

    def CreateMyDialog():        
        self.dialog = vs.CreateLayout( DialogName, 0, 'OK', 'Abbrechen' )
        dialog = self.dialog
        
        vs.CreateStaticText(dialog, 1, 'title1', width)
        vs.CreateStaticText(dialog, 2, 'title2', width)
        vs.CreateStaticText(dialog, 3, 'title3', width)
        

        vs.CreatePullDownMenu( dialog, 11, width )
        vs.CreatePullDownMenu( dialog, 12, width )
        vs.CreatePullDownMenu( dialog, 13, width )

        vs.SetFirstLayoutItem( dialog, 1 )
        vs.SetBelowItem( dialog, 1, 11, 0, 0 )
        vs.SetBelowItem( dialog, 11, 2, 0, 0 )
        vs.SetBelowItem( dialog, 2, 12, 0, 0 )
        vs.SetBelowItem( dialog, 12, 3, 0, 0 )
        vs.SetBelowItem( dialog, 3, 13, 0, 0 )

        vs.RunLayoutDialog(dialog, Dialog_Handler )


    CreateMyDialog()

    #outputs
    self.Params.sPopup1.value = self.v1
    self.Params.sPopup2.value = self.v2
    self.Params.sPopup3.value = self.v3

 

 

BR KC

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

better way

Hallo KingChaos

 

Als Schreiner kann ich dir kaum behilflich sein.

Wenn du jemand findest, der dir einen Popup-Knoten mit einem Eingang baut, dann kannst du die Werte aus einer Tabelle abrufen.

Wenn du einen bekommst, ich bin auch ein Abnehmer dafür. 

 

Mein Bild im Anhang ist zusammengebastelt. Es zeigt lediglich meine Die zu deinem Wunsch.

 

 

Gruss

1633967834_Bildschirmfoto2022-02-07um20_10_07.thumb.png.11ffb6b3345f9814cd9f54e3faac7ed8.png

 

  • Like 1
Link to comment

if that works great plan, but how to get the next choice out the sectionmeasures and how it will read out the artikelnummer?

 

The File i made is working now good but the selection is missing.

 

I got a steel profile:

- chamfered/rounded or not

- hollow or not

- with drillings/copunterdrillings

- controllable side of counterdrillings

- controllable stop and and measure of the drillings,

- drilling diameters

- miter on both edges

- the piece is named with length measure in the name (name is in a databasefield)

- has an article number

- has material text

- infotext for drillings, counterdrillings, miters automatically and addeable informationtext.

- you can rotate the object

 

Maybe you have some more ideas or destroy my plan while u think the stuff is too slow because my spaghetticode slows die program down. 🙂

 

 

I will now:

 

apply texture -> into coating databasefield.

 

I really need the popup, because THEN is can make ALL these metal parts in just 1 file and i can morph them with parameters.

 

in the end i need some achorpoints for the next steel part at the top and in the middle, so i can build them together with another marionette to have real parametrical Shelf for Tego.

 

what do u think?

 

I think its worth the hours i worked (8 h so far) on, because later all my collegues cant pick a wrong steel/alu part if the popup works and they never have to layout them because all u can read out with stamps.

 

 

BR KC

ProfilGeometrieRechteckBohrungen_V4.vwx

Link to comment
12 hours ago, KingChaos said:

wie kann man die nächste Wahl aus den Abschnittsmaßnahmen treffen und wie es die Artikelnummer vorlesen

 

Die beiden String's werde ich durch Popup Knoten ersetzten und dort die Vorauswahl definieren.
Die Herstellernummer hohle ich durch das Abgleichen der Spalten eins und zwei. Der index ergibt dann zum Beispiel 0, 5, 13 und 3, 5, 21.
Die Überschneidung von Index 5 ergibt mir anschliessend die Zeilennummer (Is Member).
Anschliessend musst du nur noch die entsprechnnde Zelle abrufen.


 

I will replace the two strings with popup nodes and define the preselection there.
I get the manufacturer number by comparing columns one and two. For example, the index is 0, 5, 13 and 3, 5, 21.
The intersection of index 5 then gives me the line number (Is Member).
Then all you have to do is call up the corresponding cell.

1430903750_Bildschirmfoto2022-02-08um20_18_22.thumb.png.600dc6c731d9098044e147c26eda3799.png

  • Like 1
Link to comment

so habs fertig 🙂

 

bis auf ein paar bugs, laeuft es.

 

Wenn ich das als wrapper einsetze und die Teile aneinander baue habe ich wohl das "problem" dass der popup fuer jedes eingefuegte Teil abgefragt wird, da muss ich noch mal drueber nachdenken.

 

heute nachmittag schieb ich den file hoch ok? dann kansnte dir das angucken.

 

besonders gut finde ich, dass wenn du das als wrapper einbaust, das naechste teil zum positionieren einfach mit dem knoten des 1. verbindest und dann bleibt das 2. Teil auch am 1. sitzen, wenn du das verschiebst oder modifizierst in laenge und gehrungswinkel.

 

Wenn ich ein neues PRofil brauche, muss ich also nur die tabelle modifizieren und habe sofort das neue teil im popup verfuegbar.

Link to comment
1 hour ago, KingChaos said:

das "problem" dass der popup fuer jedes eingefuegte Teil abgefragt wird

Cool wäre, wenn der popup den letzten Wert verwenden und nur bei Bedarf in der Info-Palette via Dropdown verändert würde.

 

Wer hat dir den Knoten gebaut?

 

 

Ja, ich schaue gerne in deine Datei hinein 🙂

 

Link to comment

Cooles Teil, eine Verweis-Funktion mit Auswahlmöglichkeit der entsprechenden Liste!

 

Wenn du den hWorksheed abrufen möchtest, kannst du den Knoten "Name" verwenden.

So kannst du gleich den Zwischenschritt mit "Net Worksheet" weg lassen.

 

Das Handling mit dem Popup stört mich einwenig. 

Ich würde die Auswahl in die Infopalette verbannen.

So dopt das teil auch nicht bei jeder Änderung auf.

"mein Wunsch"

 

 

 

Bildschirmfoto 2022-02-10 um 09.53.50.png

Link to comment

245346196_Bildschirmfoto2022-02-10um10_32_12.thumb.png.99984fa8b85c58c0b836aa8471f19ea4.png

 

Das "gucken" bedeutet, dass die "Options" angepasst werden müssen...

ich denke da an Import.list oder so etwas.

 

 

 

 

 

#MRoth
#V1.0 20200327

@Marionette.NodeDefinition
class Params(metaclass = Marionette.OrderedClass):
#APPEARANCE
    #Name
    this = Marionette.Node( 'Popup enhanced' )    
    this.SetDescription('This node displays a popup window and returns the index and string from the selection. The default settings must be changed in the code itself. ')
    
    #Options
    #_________Enter your values in the line below.__________
    options = ['t1', 't2', 't3', 't4', 't5','t6'] 
    
    #Input Ports
    dListItems = Marionette.PortIn( [], "listChoices")
    dListItems.SetDescription( "A list of items to go in the popup." )
    
    #OIP Controls
    input = Marionette.OIPControl( 'Popup', Marionette.WidgetType.Popup, 0, options)
    input.SetDescription('An OIP control representing the options designated within the script editor')
    
    #Output Ports
    int = Marionette.PortOut('i')
    int.SetDescription('The zero-based index of the selection.')
    str = Marionette.PortOut('s')
    str.SetDescription('The string of the selection.')
    
#BEHAVIOR

def RunNode(self):
    #inputs
    int = self.Params.input.value
    options = self.Params.options
    
    #script
    str = options[int]
    
    #outputs
    self.Params.int.value = int
    self.Params.str.value = str

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