Notifications
Clear all

[Closed] MCG Loop with current index and value

 MZ1

Anybody knows how we can create this loop inside MCG?


Val = 0
for i = 0 to 10 do
(
 Val += i
 -- >> Out i
 -- >> Out Val
)

Note that we need to send i and Val out for each loop to use in other part of the graph.

35 Replies

oh… that’s why i don’t mess with the MCG.

if there was no vusta, I would say that MCG is a uselessly spent time.

vusta is one of the best MCG developers… no… he is the best, and one only

1 Reply
(@swordslayer)
Joined: 11 months ago

Posts: 0

2018:

As Chris Diggins is no longer at Autodesk and it looks we’ll get stuck with the current MCG iteration forever, playing with MCG feels like wasted time. Unless you approach it as a kind of newspaper crossword puzzle, no real use just a brainteaser of sorts.

hahaha…what took you so long Doc…yeah the graph takes waaaay more real estate than a line of code, no argument there.

Of course, the graph is to help someone who can’t code…like me…if you can code…best to stick to coding…at the end of the day…everything is encoded to 0s and 1s.

As for best cough, well there’s MCG stuff other ppl did years ago I still haven’t figured out…

1 Reply
 MZ1
(@mz1)
Joined: 11 months ago

Posts: 0

I prefer to do it with the code (Scripted Plugin), but it seems MCG converts some code to .NET and this will improve performance.

you could go with this for an array of tuples:

 MZ1

Thank You! for your quick reply, but sorry I’m using max 2018 and there is no “Map” operator!

 MZ1

In this case, “Zero based” is not important for me, so I edited my question to start the loop from 0.

just use the Repeat logic, substitute the PlusOne with a Passthrough Integer,

Note that when N = 10 the loops goes from 0 to 9

1 Reply
 MZ1
(@mz1)
Joined: 11 months ago

Posts: 0

What You think about “At” operator? do you think we can use it here?

if you ALREADY have an array, and you want to read the 13th element from it, then use At 12 (since arrays start at 0)

believe it or not…This IS the real reason why I do MCG…as a puzzle to keep the brain alive…yes, I’ve been asked a millions times but I never said this was the real reason coz… who would believe me ?

As for C Diggins…hmm…well did you just break an NDA ?

1 Reply
(@swordslayer)
Joined: 11 months ago

Posts: 0

Nope, that’s public info for quite some time, check his own work history + announcement on linkedin: ‘I am pleased to announce that starting in January I will be joining the Clemex team in Montreal.’ I am always pessimistic – hoping to be proven wrong, though, so maybe there’s a silver lining somewhere…

I’m kinda in the same boat, plus I love functional programming and immutability. But I stopped frequenting the facebook MCG group a while ago (I don’t really use facebook aside from messenger) and only have MCG alert set for the area forums – and there’s like one post in three months or more…

Page 1 / 2