hexagon logo

Why can't you write programs like this? Do you understand?

The construction feature cannot be written as [1.. N],

The results are marked in red。

Software version: 2024.1

Parents
  • Did this work in older versions? I believe you need to tell it what loop the points are from too, like

    CONSTR/PLANE,BF,PNT1[1], PNT1[2], PNT1[3] and so forth

    If you do your construction from the window what does it show?

  • The syntax would be PNT1.HIT[1]

    You can also use all hits from a feature by using 

    PLN2.HIT[1..PLN2.NUMHITS]

  • But since it's a loop of a single point he is using to construct a plane in his example, do you still need .HIT? It's a point, so .HIT[1] would just be the point I believe as if it was just PNT1

    I know you can also just do PLN2.HIT[..]


    I remember loops work kind of like array variables, where you can select which value from the array by doing V1[1], and in this case you select which instance of PNT1 to use for the construction by using the PNT1[1], but I may be wrong. I suck at loops cause I never use them

    Also, good to see you floating around still, I remember you had only recently came back to the demon side

Reply
  • But since it's a loop of a single point he is using to construct a plane in his example, do you still need .HIT? It's a point, so .HIT[1] would just be the point I believe as if it was just PNT1

    I know you can also just do PLN2.HIT[..]


    I remember loops work kind of like array variables, where you can select which value from the array by doing V1[1], and in this case you select which instance of PNT1 to use for the construction by using the PNT1[1], but I may be wrong. I suck at loops cause I never use them

    Also, good to see you floating around still, I remember you had only recently came back to the demon side

Children
  • Ah, my mistake - I do not particularly use loops as I tend to have other ways to iterate through points, especially with something as low as 8-12 hits (if it were a few hundred that couldn't be plunked into a scan I could see the appeal; my only use for loops is for re-running the program a few times for some statistics.

    If it were a variable, it would appear that Henniger123's solution below would be the correct one, and that the last number should be replaced by the variable used to maintain the count (so if you change the variable, the loop doesn't break).

    And glad to be back! Much more fulfilling than my previous work.