Attributes that auto update when moving along a path

Attributes that auto update when moving along a path

Strydaris2492
Advocate Advocate
668 Views
8 Replies
Message 1 of 9

Attributes that auto update when moving along a path

Strydaris2492
Advocate
Advocate

Hi everyone,

 

I am looking for an answer to a question I have been having regarding using a lisp to show a dynamic attribute value of sorts.

What I am looking to do or know if you can actually do it is if you can insert an attributed block along a set path, then after insertion and before the lisp finishes, be able to MOVE that block and have the attribute dynamically update as you move it.

For better context, I have 2 grade elevation points and I need to find a point between those 2 points, but lets say I noticed I misplaced the the point I needed and want to move it before exiting the lisp. If I move it I want to be able to see it as I move it along the set path between the 2 original points as well as see the value of the attribute change as I move it.

I know moving something along a path is possible using the vlax-curve functions. And I know I could do the math for the value using something like vlax-curve-getClosestPointTo. What I dont know is if you can have the attribute show the updated value as you move it.

Anyone have any thought on this?

 

Thanks.

0 Likes
669 Views
8 Replies
Replies (8)
Message 2 of 9

MrJSmith
Advocate
Advocate
Might be able to attach an object reactor to it that updates its value as you move it. https://www.afralisp.net/visual-lisp/tutorials/reactors-part-3.php
0 Likes
Message 3 of 9

hosneyalaa
Advisor
Advisor

@Strydaris2492  Hi 

Can you attached example drawing 

 

0 Likes
Message 4 of 9

Sea-Haven
Mentor
Mentor

If you use mtext with a field with say X,Y then move reference object it will change, but you need a regen to force the mtext change. A pretty easy lisp with regen as last step.

0 Likes
Message 5 of 9

Strydaris2492
Advocate
Advocate
Hi Sea-Haven,
Thanks for the reply.
I am trying to avoid fields as the math to get my point is fairly complex. Too many "solve this angle first to get this side" then use that to solve this etc etc.
Message 6 of 9

Strydaris2492
Advocate
Advocate
Thanks MrJSmith, I will check out this option. Not sure now to do this, but at least its a suggested solution.
0 Likes
Message 7 of 9

MrJSmith
Advocate
Advocate

If you knew how to do it, you wouldn't have been asking ;).

Honestly, I am not that familiar with object reactors myself; however, it might not work for you as it sounds like you want the update of the info to happen while you are moving the object in real time? In which case the object reactor might not get triggered until the move command has ended as I think it is only called on update of the entity.

The only other thing I could think of is using a grread while loop to constantly trigger the update with each movement of the mouse. Lee Mac has several good examples of this. http://www.lee-mac.com/grtext.html and http://www.lee-mac.com/dynamictextalignment.html

0 Likes
Message 8 of 9

Strydaris2492
Advocate
Advocate

Ya I am not too sure about the reactor stuff either.

I did see Lee Mac's grread functions as well and was thinking those might work.

Just not sure how to implement those just yet. I would like the grread info to look like that is being inserted.

 

First things first though, I need to get my formula to do the calculations I need working now matter which way things are selected as well as draw my polyline the proper direction no matter what the UCS is.

 

I think I need to rethink the coding a bit. 

Message 9 of 9

Sea-Haven
Mentor
Mentor

A complex formula in a defun will update in a blink of an eye, so dont see a problem, working on a slider dcl drawing lines and lines are redrawn with the dcl redisplayed can not see it happening. 

0 Likes