Jump to content
Sign in to follow this  
creakesiv

Ask: Move temp node along line

Recommended Posts

Is there a way to move a temp node along the line it was created from?

 

What I am looking to do is create a node at each end of a curved line, then bring those nodes in 10mm along that curved line. 

 

Thank you,

-Clay

Share this post


Link to post
Share on other sites

Figured out a method that is a little more complicated on the user end, but works fine.

 

Use the "Length" command to get length of line

Calculate percentage of that line = to 10mm of length

Create nodes using "Extract Parametric"

Change upper and lower bound to represent the calculated percentages for the 10mm displacement

Share this post


Link to post
Share on other sites

Try my following code:

*createmarkpanel lines 1 "Select Lines"
set lines [hm_getmark lines 1]
*clearmark lines 1;
set dist 10.0;
foreach id $lines {
	set length [hm_linelength $id]
	if {$dist < [expr $length/2]} {
		set ratio1 [expr $dist/$length]
		set ratio2 [expr { 1.0 - $dist/$length } ]
		eval *createdoublearray 2 $ratio1 $ratio2
		eval *nodecreateatlineparams $id 1 2 0 0 0
		puts [format "Line %d : Nodes at %0.6f %0.6f" $id $ratio1 $ratio2]
	}
}
*clearmark lines 1;

HTH,

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
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.

Sign in to follow this  

×
×
  • Create New...