Jump to content

vex : addvertex with foreach


jimsunglady

Recommended Posts

8 hours ago, jimsunglady said:

I don't understand. Is pt different from @ptnum? 

Isn't list a list of @ptnum?

First of all, VEX function run on  all points at the same time.

nearpoints() put in a list, all points found from the current point position in 2 m radius.

For exemple for point number 0 :

@list =[0,2,3,7]

Then foreach will run over each point in this list, with variable pt (int pt)

Exemple for the second loop :

@ptnum = 0

pt= 2

The third loop:

@ptnum = 0

pt = 3

Be aware than nearpoints() will always return the actual point (@ptnum) as the first of the list. So in your case,  you will get some lines with the same point for each point in your geometry:

The first loop:

@ptnum = 0

pt = 0

 

Link to comment
Share on other sites

  • 1 month later...

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.   Paste as plain text instead

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