LDCad Lua - prompt and wait for selection?


RE: Lua - prompt and wait for selection?
#9
(2021-09-25, 18:58)Roland Melkert Wrote: If you, or anyone else, has some additional ideas on api extensions please let me know.

A longer explanation may be helpful before the suggestion. This post about wanting an animation for a 4 bar linkage started me thinking and fiddling with some scripts to try to come up with a user-friendly point-and-click solution. The thinking and fiddling has been the reason for my recent questions/API suggestions.

As part of coming up with a solution, I needed a test assembly. At one point it looked something like this screenshot.
[Image: 400x298.png]

Leveraging the technique described in your LDCad advanced editing page, I was able to determine how much to rotate the red and light bluish-gray liftarms to ensure the holes in the liftarms were correctly aligned. And that got me thinking. It might be helpful if there were a script which would (a) work out the necessary rotations, (b) show a preview of the rotation and © allow the user to apply or discard the rotations.

The next step was to conceptualize what would be required from the API to be able to write such a script. Here are the resulting thoughts/suggestions.
1) I'm inclined to think that this would require the "prompt/select" capability suggested earlier in this thread (i.e. your macro:waitForEvent() thoughts).
(2) Suggested API addition #1. Add the ability to display/hide the connection points for a part, which would be driven by the data in the shadow library for the part.
(3) Suggested API addition #2. Add the ability to select a part's connection point, visible from thought #2.

With these two additions to the API, it could help reduce/eliminate the need to add temporary parts to a model to help when attempting to align non-simple assemblies.

Happy to discuss further if desired.

Regards,

David
Reply
« Next Oldest | Next Newest »



Messages In This Thread
RE: Lua - prompt and wait for selection? - by David Manley - 2021-09-26, 22:48

Forum Jump:


Users browsing this thread: 1 Guest(s)