Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,542
» Latest member: Seth Bray
» Forum threads: 6,314
» Forum posts: 52,574

Full Statistics

Online Users
There are currently 361 online users.
» 0 Member(s) | 357 Guest(s)
Applebot, Baidu, Bing, Google

Latest Threads
Vertex precision
Forum: Official File Specifications/Standards
Last Post: Orion Pobursky
9 hours ago
» Replies: 5
» Views: 1,587
LEGO Parts Guide - Only 6...
Forum: Part Requests
Last Post: tom alphin
10 hours ago
» Replies: 5
» Views: 215
98138pb0.dat is missing i...
Forum: Parts Authoring
Last Post: Magnus Forsberg
Yesterday, 15:31
» Replies: 2
» Views: 103
How can I install on linu...
Forum: Help
Last Post: Orion Pobursky
Yesterday, 4:48
» Replies: 1
» Views: 76
Castle Ninja / Robber
Forum: Part Requests
Last Post: Carl Rodabaugh
Yesterday, 1:06
» Replies: 0
» Views: 70
help finding ldraw for el...
Forum: Help
Last Post: Brian H
2025-12-30, 23:22
» Replies: 2
» Views: 112
Missing Opal Trans Yellow
Forum: Official File Specifications/Standards
Last Post: Philippe Hurbain
2025-12-30, 19:27
» Replies: 3
» Views: 252
LEGO Icons 2025
Forum: Official Models
Last Post: Philippe Hurbain
2025-12-30, 9:53
» Replies: 4
» Views: 5,084
Minifigure, Head Brown Ey...
Forum: Part Requests
Last Post: Philippe Hurbain
2025-12-30, 9:20
» Replies: 2
» Views: 159
Technic 1992
Forum: Official Models
Last Post: Takeshi Takahashi
2025-12-28, 19:34
» Replies: 29
» Views: 42,265

 
  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

Print this item

  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
Code:
first_call_ai

can a value be passed via the setEvent API e.g.
Code:
macro_lo:setEvent('run', 'linkage_parts_select_gf', '1')

Regards,

David

Print this item

  Seeking a ldcad animation script method
Posted by: belle - 2021-09-24, 2:12 - Forum: Rendering Techniques - Replies (16)

我想制作曲柄摇杆机构的动画,但一直没有合适的方法。我希望你能我。最好有脚本模板,帮助像附件。

非常感谢您



Attached Files
.gif   src=http___5b0988e595225.cdn.sohucs.com_q_70,c_zoom,w_640_images_20180519_3bf6c937be7b4259b0a41269132c6f6a.gif&refer=http___5b0988e595225.cdn.sohucs.gif (Size: 244.54 KB / Downloads: 158)
.ldr   demo.ldr (Size: 1.03 KB / Downloads: 6)
Print this item

Question Exporting Contour Lines Along with Snapshot in LDView
Posted by: G.D. Grant - 2021-09-23, 20:56 - Forum: LDraw Editors and Viewers - Replies (8)

Even though I set LDView to display contour lines, I do not see these in the exported snapshots.
Is this even possible in LDView? In my mind, the definition of "snapshot" meant something closer to a screen capture. The only two reason I'm not actually capturing my screen and re-cropping the image later on is that I want large detailed images and I use transparent bricks.
Additionally, is it possible to get monochrome part faces (no lighting, just plain colours... as in a cartoon?)
Thanks.


--
G.D. Grant

Print this item

  Part Request: 72224pb03 Dragon Head (Ninjago) Jaw with 2 Bar Handles on Back
Posted by: Prieto - 2021-09-23, 19:12 - Forum: Part Requests - Replies (3)

Hello LDraw community.

I would like to know if someone is currently working on a .dat for the element ID 72224pb03 (The lower jaw of the latest Ninjago dragons)
https://www.bricklink.com/v2/catalog/cat...3#T=C&C=69

[Image: 72224pb03.png]
I want to use the piece in the short-term, but I haven't found it in any 3D software library yet. As I don't own the physical part, I am unable to take precise measures and/or proper reference material to sculpt my own version in Blender.


Thank you in advance for any help you could provide.

Print this item

  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

Print this item

Thumbs Up 15424 Cowboy Hat
Posted by: G.D. Grant - 2021-09-22, 19:21 - Forum: Part Requests - Replies (3)

Here's the link to the part on BrickLink: [url=https://www.bricklink.com/v2/catalog/catalogitem.page?P=15424#T=C][/url]part 15424

[Image: 15424.png]

There's also a version with a printed star in front (distributed in black.)

[Image: 15424pb01.png]

Thanks.

Print this item

  Friends Puppy Poodle 11575
Posted by: Takeshi Takahashi - 2021-09-22, 3:10 - Forum: Part Requests - Replies (2)

Hello,

Thanks again for creating my previous requested parts.

I'd like to request Friends Puppy Poodle 11575 for the next set 41007 in Friends OMR project.
https://forums.ldraw.org/thread-24146.html


https://www.bricklink.com/v2/catalog/cat...=1#T=C&C=1
http://www.digital-bricks.de/en/index.ph...ddp&mg=259

I'll try to make printed patterns, so the part body is sufficient.

Print this item

  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.

Print this item

Question Can't Export SVG Image from LDView Snapshot?
Posted by: G.D. Grant - 2021-09-21, 14:00 - Forum: LDraw Editors and Viewers - Replies (1)

Greetings all.
Anyone know a way to export an LDraw model render to SVG format? Converting a raster image to a vector after rendering the model can lead to misinterpretations from the converter (e.g. stains instead of lines, etc.) Well... You all know how converting raster to vector goes.
I'd like for the geometry of the model to accurately be interpreted by the SVG image, simply.
I notice SVG exports aren't possible in LDView, unless I'm missing on something(?) It seems as if the only options are PNG, BITMAP and JPEG.
If I'm right about this feature not being available in LDView, is there any other LDraw program that would allow this type of operation?

Thanks in advance for any help.

God bless.


--
G. D. Grant

Print this item