| Welcome, Guest |
You have to register before you can post on our site.
|
| Online Users |
There are currently 8 online users. » 1 Member(s) | 1 Guest(s) Applebot, Baidu, Bing, Facebook, Google, Twitter, Tom Lemmens
|
| Latest Threads |
Part Vs. Shortcut
Forum: Parts Tracker Discussion
Last Post: Philippe Hurbain
2 hours ago
» Replies: 3
» Views: 121
|
Cutting down sticker imag...
Forum: Parts Authoring
Last Post: Philippe Hurbain
2 hours ago
» Replies: 2
» Views: 111
|
Missing Stingrays/Hydrona...
Forum: Part Requests
Last Post: Chris Böhnke
10 hours ago
» Replies: 14
» Views: 3,410
|
Pirate Themed Parts
Forum: Part Requests
Last Post: Charlotte Evans
Today, 2:27
» Replies: 50
» Views: 46,019
|
Super Mario tiles with st...
Forum: Parts Tracker Discussion
Last Post: Chris Böhnke
Today, 2:05
» Replies: 10
» Views: 254
|
LDCad 1.7 Beta 2b (win+li...
Forum: LDraw Editors and Viewers
Last Post: Roland Melkert
Yesterday, 23:04
» Replies: 16
» Views: 5,774
|
Meta Quest 3 block buildi...
Forum: All Other Programs.
Last Post: Joseph Miller
Yesterday, 19:59
» Replies: 1
» Views: 569
|
Parts Request: Exploriens...
Forum: Part Requests
Last Post: Chris Böhnke
Yesterday, 0:51
» Replies: 1
» Views: 667
|
Electric contacts, Plug o...
Forum: Parts Authoring
Last Post: Magnus Forsberg
2026-11-15, 16:45
» Replies: 0
» Views: 147
|
Minifig Torso with HP Qui...
Forum: Parts Authoring
Last Post: Tom Lemmens
2026-11-15, 16:33
» Replies: 4
» Views: 299
|
|
|
| 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.
|
|
|
|