| Welcome, Guest |
You have to register before you can post on our site.
|
| Online Users |
There are currently 117 online users. » 0 Member(s) | 112 Guest(s) Applebot, Baidu, Bing, Google, Yandex
|
| Latest Threads |
2026 - New Parts -> Raw M...
Forum: Part Requests
Last Post: Gerald Lasser
Yesterday, 21:23
» Replies: 6
» Views: 4,085
|
Teenage Mutant Ninja Turt...
Forum: Official Models
Last Post: Chris Böhnke
Yesterday, 5:19
» Replies: 8
» Views: 3,130
|
LDraw.org 2026-05 Parts U...
Forum: LDraw.org Announcements
Last Post: Orion Pobursky
2026-05-31, 20:11
» Replies: 0
» Views: 170
|
Most Common Parts - 16 im...
Forum: Part Requests
Last Post: tom alphin
2026-05-30, 15:05
» Replies: 4
» Views: 531
|
Current LEGO Colour Palet...
Forum: Parts Authoring
Last Post: Chris Böhnke
2026-05-29, 21:24
» Replies: 2
» Views: 374
|
LDraw.org Official Parts ...
Forum: Parts Tracker Discussion
Last Post: Manfred Schaefer
2026-05-29, 12:14
» Replies: 18
» Views: 1,473
|
Hello! Parts 30258pb006,...
Forum: Part Requests
Last Post: Matthew
2026-05-27, 23:02
» Replies: 6
» Views: 622
|
Successor to LL918 using ...
Forum: MOCs (My Own Creations)
Last Post: Willy Tschager
2026-05-27, 13:05
» Replies: 1
» Views: 321
|
at rt
Forum: MOCs (My Own Creations)
Last Post: Jeff Jones
2026-05-27, 8:47
» Replies: 3
» Views: 427
|
One week to go.
Forum: Parts Tracker Discussion
Last Post: Magnus Forsberg
2026-05-25, 16:00
» Replies: 0
» Views: 319
|
|
|
| Lua - prompt and wait for selection? |
|
Posted by: David Manley - 2021-09-25, 4:23 - Forum: LDraw Editors and Viewers
- Replies (20)
|
 |
Hi Roland,
another LDCad scripting question for you.
I'm trying to write a script which will loop, prompt the user to select a particular part and then wait until the part is selected before moving to the next prompt/part selection. Looking through the sample Lua scripts, they seem to expect any part selections to be done prior to invoking the macro. But I'd like to have a script which will prompt the user as they go, so they don't have to remember the order in which to select the parts.
The Lua script I am using is invoked as a macro and looks something like this (it has been simplified to assist in understanding its purpose):
Code: -- Clear the current selection (if there is one).
local selected_item_lo = ldc.session.getCurrent():getSelection()
if (selected_item_lo ~= nil) then
selected_item_lo:remove()
end
-- Prompt for the appropriate part.
prompt_ls =
{
'Select the part/subfile which drives the rotation.'
}
linkage_phase_si = linkage_phase_si + 1
ldc.dialog.runMessage(prompt_ls[linkage_phase_si]);
-- Loop until an item is selected.
repeat
selected_item_lo = ldc.session.getCurrent():getSelection()
until (selected_item_lo:getRefCount() == 1)
ldc.dialog.runMessage('Done')
Basically, the intention of the script is to display a message dialog and, once the dialog is closed, wait until the user selects a part. However, when attempting to run this macro, the console open and displays the message
Code: "linkage_parts_select_gf" execution exceeded the maximum duration of 250ms.
linkage_parts_select_gf is the name of my macro containing the script.
Is there a "proper" way to achieve what I'm wanting to do (i.e. wait until a part is selected) using the LDCad Lua scripting?
Regards,
David
|
|
|
| setEvent, 'run' and passing parameters to macro? |
|
Posted by: David Manley - 2021-09-25, 1:45 - Forum: LDraw Editors and Viewers
- Replies (2)
|
 |
Hi Roland,
with 1.7 scripting API in LDCad, is it possible to pass an argument to a macro when it is run? For example, if I have a macro named:
Code: linkage_parts_select_gf
which has a single argument
can a value be passed via the setEvent API e.g.
Code: macro_lo:setEvent('run', 'linkage_parts_select_gf', '1')
Regards,
David
|
|
|
| Cannot Find my LDraw Library... |
|
Posted by: G.D. Grant - 2021-09-23, 13:46 - Forum: Help
- Replies (2)
|
 |
Prepare to hear something ridiculous...
I lost my LDraw library. Can't remember where I put it on my PC anymore.
I remember doing a manual installation for some nerdy reason and, therefore, my parts library is perhaps not at the default location where the AIOI would have put it...
Is there any way to find the folder where I put my official parts via any LDraw program's preferences settings? I currently have LDView, LDCad, MLCad and LeoCAD installed (all are working properly.) I would like to find my parts library for two main reasons: LPub3D is begging me to, and I would like to add custom parts to it as well.
Thanks in advance for any help.
Cheers. ?
--
G.D. Grant
|
|
|
| Problem with part 2907 |
|
Posted by: N. W. Perry - 2021-09-22, 3:02 - Forum: Parts Tracker Discussion
- Replies (5)
|
 |
If I'm not going mad, there's something amiss with part 2907 in the library.
Check out the Rebrickable entry—all the images there, even their rendering of the LDraw part, show the grooves rotated 22.5° from where they are in the actual library part. Did this get changed during some update? Is there a different version of the part somewhere else?
From the photo, it's clear that the grooves, not the fins, should be at the 8 compass points.
|
|
|
|