Jon61

MLCad - imported unofficial parts not showing on-screen (unless run as Administrator)

Recommended Posts

Having used MLCad without problems for a few years (though fairly infrequently, so there's lots about it I don't know) I've recently been having some issues bringing in some unofficial parts (the first time I've tried to do this). I've struggled with this for some hours, and then tried to find if the issue had already been covered online, but I can't find anything that helps, including looking in the Section Index of this forum and attemtpting to search for related threads - apologies if I've missed it (or if I've done something silly in getting to where I am). Sorry also for the lengthly description below!

The short version is that I believe I have managed to add some 'unofficial' parts in my MLCad library - they are showing up in the Parts Tree, and can be built into a model without 'Unknown Part' errors - but the 3-D representation of those parts does not appear on screen, either in the Parts Preview window, or in the rendering of the model within MLCad. The parts do however appear when the model is subsequently viewd using LDView. The problem only happens when using MLCad without Administartor privileges though.

The detail:

As I'm using a different PC to the one I last used MLCad on, I have recently done a new installation to a Windows 10 PC, using the All-in-one-installer, so it should be a standard installation, in the folder C:\Users\Public\Documents\LDraw. I normally use a non-administrator account, and MLCad 3.51 (and LDView 4.3) seemed to work fine on this installation when I was just using the standard library, but I wanted to use some of the new-ish parts included in the 42099 inventory, and this is where I had problems. I used the LDraw2001.exe file to bring my standard library as far up-to-date as possible (I think). After this update, for example, I have access to the 3x3 connector 39793 - it shows up in both the Parts Tree and Parts Preview windows, and I can use it in models. But that still left me without the new CV Joint parts and the planetary hubs, so I went looking online for unofficial parts for these items.

I found various articles online about using unofficial parts, but I wasn't entirely clear after reading them exactly what needed to be done. In particular, I was left somewhat unclear for example about:
- the particular purposes of the separate 'Parts' and 'P' folders;
- why you would want to SHOW some but HIDE others in the MLCAD.ini file;
- what exactly the 'Scan Parts' instruction does, and when you need to use it;
- what program(s) use the Part.lst file (or the Parts.xml file) as opposed to simply looking for .dat files in the relevant folders.

Following Holly-Wood's instructions (http://www.holly-wood.it/mlcad/unofficial1-en.html) as best I could, I found the parts for the new CV joints (52730 & 52731) and the planetary hubs (46490) in the LDraw.org parts tracker, downloaded them (including required sub-parts) and put them in the <LDRAWDIR> Parts and Parts\s folders as appropriate. I have amended the MLCad.ini file following his example, un-commenting the lines referring to SHOW <LDRAWDIR>Unofficial\Helper and SHOW <LDRAWDIR>Unofficial\Custom (although I don't understand the significance of this, as the new parts aren't in these particular folders?).

But starting MLCad (using my normal non-adminstrator account) after these changes did not appear to bring in the unofficial parts I'd added. I tried "Scan Parts" which did report new parts and offered to write a new Parts.lst file, which I accepted, but this did not seem to make any difference (from the timestamp, I don't believe that the Parts.lst file was actually being updated).

By trial and error, I discovered that if I ran MLCAD instead as an administrator, the new parts I'd added did appear in the Parts Tree and the Parts Preview, and I could use them as normal in my model. That wasn't enough however for them to subsequently appear in MLCad when run later without administrator rights however. But if ran "Scan Parts" while using MLCad as an administrator, I was able to update the Parts.lst file. And subsequently, running MLCad without administrator rights then did have the new parts shown in the Parts Tree. But even though I could use them in a model (without 'Unknown Part' errors), they appeared only as a blank space in the Parts Preview window, and they did not show up in the actual model windows - which mean that they are practically unusable within MLCad as you can't see where you are placing them (other than by the coordinates in the parts list). See screenshots below for examples. They are definitely included in the library and in the model though, as a model built using them will display the added parts correctly using LDView. Also, MLCad shows the correct information in the status line when the cursor hovers over the blank space in the Parts Preview window.

MLCad run with Administrator rights - the planetary hub and the CV parts show up in the Parts Tree, the Parts Preview window and in the model:

Unofficial Parts Test - Administrator Account2

The same model loaded into MLCad without Administrator rights - the new parts show up in the Parts Tree window, but only appear as blank spaces in the Parts Preview WIndow and in the model. Note that the cursor was hovering over the 'Technic Steering Constant Velocity 8mm Joint Female' part in the Parts Preview window when the screenshot below was taken, and the corresponding details appear in the status line, so the parts are present in the library

Unofficial Parts Test - Ordinary User Account2

The model viewed in LDView:

Unofficial Parts Test - LDView

So it would appear that something I've done (or not done) has messed up the rendering of the 3-D model of the added parts within MLCad - but only if run without administrator rights. Can anyone shed light on what I need to do to correct this?

I am particularly puzzled by this behaviour, as I thought that regardless of whether MLCad was run as an administrator or not, it was still using the same installation of the program, the same MLCad.ini file etc in the <LDRAWDIR> folder, and so I don't understand how the part 3-D model can show up in one place and not the other. I can just about understand how MLCad can apparently be unable to update Parts.lst unless it has administrator rights, as that involves writing to a file. But surely, once the parts are in the library, displaying a 3-D represntation of a part from the library should only involve reading from a file(s), so why does administrator rights make this difference? Having said that, there are clearly other things going on with the setup of MLCad that I don't understand, as when I run it with adminstrator rights, I don't see the changes I made to the 'Settings/Parts Tree/Tree Configuration' that I made as an ordinary user. So that part of the setup must be stored somewhere separately for my 'administrator' user to my ordinary user, although as far as I can only see, they're both using the same 'C:\Users\Public\Documents\LDraw' folder?

Any help would be gratefully received, including pointers to where I might find the answer elsewhere if necessary.

PS I understand that could carry on using MLCad with administrator privileges to avoid this issue, but I would rather not do that if possible.

And I am in awe of the capabilities of MLCad and the other LDraw programs, so am very grateful to the folks that enable them to be provided free for the community.

Setup:
Windows 10
MLCad 3.51
Environment variable <LDRAWDIR> is set up and points to C:\Users\Public\Documents\LDraw
The Scan_Order section of the MLCad.ini file reads as follows:

[SCAN_ORDER]
1 = SHOW <LDRAWDIR>Parts
2 = HIDE <LDRAWDIR>P
3 = SHOW <LDRAWDIR>Unofficial\Parts
4 = HIDE <LDRAWDIR>Unofficial\P
5 = SHOW <LDRAWDIR>Unofficial\Helper
6 = SHOW <LDRAWDIR>Unofficial\Custom

Share this post


Link to post
Share on other sites

I just did this last night. I don't understand all this MLCAD.ini file stuff. I don't need a whole bunch of unoffiial parts.

I simply downloaded the .dat file of the part I wanted from ldraw.org. Saved it on my PC. In MLCAD, imported it using multipart. Now, it's listed under documents. Then, just drag/ drop it into your MLCAD code where you want it. Simple. Now, it's only available for that particular model. But, it does appear in LDVIEW and LPUB3D. However, It does not appear in the PLI  or the BOM in LPUB3D. But, my LPUB3D will not connect to the internet for updates. Hope this can help you.

Edited by 1963maniac

Share this post


Link to post
Share on other sites

Thanks for the reply. Out of interest, do you use an account with administrator privileges when you use MLCad? Or, like me, a more restricted user account (ie where you occasionally need to put the admin password in to make configuration changes on your pc)? Because my imported parts show up fine when I use an administrator account, it's only my normal account where they don't show on-screen.

I'll have a go sometime at doing what you did to see if it makes a difference. I've not yet strayed into the whole area of 'multipart' models, nor LPUB3D - they're whole areas of the LDraw system that I need to understand better (especially to be able to properly use the LDraw models of the official Technic sets), but I've been putting off learning so far.

After I wrote my post last night, it occurred to me that some of the different behaviour I was seeing (not just the disappearing unofficial parts but also the different Tree Configuration settings) may possibly be down to MLCad using the registry to store settings as is more common for modern software. I must admit I usually find .ini files easier to deal with but it's not the way most software works nowadays.

Incidentally (co-incidentally I hope - I'm sure it's nothing to do with my blundering around with unofficial parts yesterday :laugh:), the whole LDraw.org domain seems to have gone offline today (I hope it's just a temporary thing of someone forgetting to pay the hosting bill rather than anything more permanent!)

(And completely off-topic just for a moment, @1963maniac, can I just thank you for your work on the building instructions for Attika's 8880 Tribute model - I came across it recently when the thread was resurrected and have bookmarked it as something I'd really like to build at some point. Just like the whole LDraw/MLCad etc system, it's very generous of you all to make all your efforts available free for the Lego community to enjoy.)

Share this post


Link to post
Share on other sites

Administrator?, nope, I don't get that deep into the program. I figured out a way to get the Chiron parts into MLCAD in 2018 and was able to make BIs for the gearboxes coming out in 2018.

I like free, it's good. This last year they have really started asking for money more on Rebrickable. I understand it but I still like FREE! 

Thanks for the kind words. And you and everyone are welcome to the free BIs I do. Attika and I worked for many months on that project. And I'm stuck on our current project because LPUB3D can't redraw"page cut off images".

Anytime you want to learn more about submodels/ call outs or anything else. Just contact me, I'd be happy to help you.

Share this post


Link to post
Share on other sites

Well I still don't understand the behaviour I was observing, where MLCad behaves differently for an 'administrator' and 'non-administrator' accounts (re User Account Control in Windows) when unofficial parts have been added to the database. But for the record in case it's of any use to others, I'll note what I've found as a way of avoiding the problem:

To summarise, what I did first was to add unofficial parts (downloaded from LDraw.org) to the <LDRAWDIR>Unofficial\Parts and the <LDRAWDIR>Unofficial\Parts\s folders as appropriate, and then update the library (Scan Parts or mklist.exe). This resulted in:
- MLCad: if I ran it as an Administrator, the unofficial parts I'd added appeared in the database and could be used just as normal. However, if I ran it using a non-Adminstrator account, the parts were in the parts available and could be added to a model, but their 3-D representations would be invisible on-screen.
- LDView: The unofficial parts, once added to a model, could be seen properly in LDView, regardless of whether I ran it with Administrator rights or not.
- LDCad: Since my first post in this thread above, I have installed LDCad for the first time and started using it. This of course uses the same installation of the LDraw parts library, so I was wondering what would happen in this program re the unoffical parts. In this case, the new parts did not appear, regardless of whether I ran LDCad as an administrator or not. In either case, unlike MLCad, the parts did not even seem to be available (even with invisible 3-D represntations) in the parts library.

As my brief experience with LDCad, I decided that I liked it and would probably use it in preference to MLCad, so it was particularly disappointing that the unofficial parts I'd added did not show up in it at all. So I decided that I'd try a slightly more risky approach, and move the few unofficial parts I wanted into the 'official' parts folders in my installation to see if that made a difference. So I removed the 7 files I'd added to <LDRAWDIR>Unofficial\Parts and put them instead into <LDRAWDIR>Parts, and similarly for the 3 files I'd added to <LDRAWDIR>Unofficial\Parts\s. And I was pleased to see that having done this, the 'unofficial' parts now show up in MLCad, LDView and LDCad, even if I run them without Administrator rights!

As I understand it, the potential problem witht his approach would be with future library updates when these parts are properly added to the official libraries. So I've kept a list of the 10 files, and will delete them from their official folders before I do the parts update that should add them officially, and hope that's enough.

Share this post


Link to post
Share on other sites

With unofficial libraries, the "<LDRAWDIR>Unofficial" method is not really standard behavior, it will depend from program to program if parts in there will be used or not.

The more modern way of working with unofficial parts is by considering it a second library with its own root folder (so you have e.g. "d:\ldraw\official" and "d:\ldraw\unofficial" both having a parts and p folder).

In LDCad I usually rename the ldrawunf.zip to something like ldrawunf-20200708.zip and use it as is (LDCad can use the library zipped) and add it before the complete.zip library search wise order.

See also

http://www.melkert.net/LDCad/faq#faq_unoflib

Edited by roland

Share this post


Link to post
Share on other sites

Thanks @roland, that's very helpful. And it explains why everything worked properly once I put the parts into my "official" folders. I'm still really puzzled by the administrator/non-administrator differences (in MLCad), but I don't need to understand them now, fortunately :classic: As I only wanted to add a few parts until they (hopefully) appear in the official libraries, and I didn't want to have to avoid lots of other unofficial parts, I think I'll live with my temporary approach for now, which works for both MLCad and LDCad.

As another off-topic comment, as I am honoured to receive a helpful comment from the author of LDCad, I can't miss the opportunity to thank you for writing and providing free such a great piece of software! I knew other LDraw-based editors were availlable, but had always thought I should learn MLCad reasonably well first before trying any others. But the 3-D model rotation system in MLCad was the aspect I've always found most awkward - I may have missed a setting that would have helped, but if I'd zoomed in to examine a partcular area of a complex model, the way it would re-centre the view each time I rotated the 3-D view was so annoying! This finally prompted me to try LDCad for the first time just a few days ago and it was very quickly obvious to me that it would be easier to use. I'm already trying out multi-part models, which I'd never got as far as attempting in MLCad. After working through your LDCad tutorial pages, the one thing I thought I was missing in LDCad was the ability to easily edit (eg re-order) parts in the underlying LDraw code - but then I discovered the Source window in LDCad, so I think it's got everything I need. And as a bonus, the rendering of the 3D view is sooo much better than MLCad!  If there are any Technic builders (in particular) who are still using MLCad (perhaps I was the last one? :oh:), I would definitely suggest giving LDCad a try.

 

Share this post


Link to post
Share on other sites
1 hour ago, Jon61 said:

I can't miss the opportunity to thank you for writing and providing free such a great piece of software!

Thanks, I started with LDCad partly because I got annoyed by the fact you can't directly edit stuff in the 3D preview of MLCad :)

Share this post


Link to post
Share on other sites
On 7/8/2020 at 1:33 PM, Jon61 said:

Well I still don't understand the behaviour I was observing, where MLCad behaves differently for an 'administrator' and 'non-administrator' accounts (re User Account Control in Windows) when unofficial parts have been added to the database.

If I understand correctly though, this is caused by Windows account management (security settings, access control etc. pp.) isn't it? 

I have never encountered any of your issues - and I am wondering why. Hmmm. Did you >install< MLCAD with admin rights?

Oh well, MLCAD was developed, when Windows was one big security issue :pir_laugh2:

Best,
Thorsten

Share this post


Link to post
Share on other sites

Yes, I think it must be a UAC issue of some kind, but I don't really know where to start to resolve it. I'm not exaclty an expert on UAC, but it does seem to work OK for everything else, and I've used non-administrator accounts since UAC was introduced several Windows versions ago. I did run the MLCad installer with admin rights (probably from a non-admin user by selecting "Run as Administrator", rather than directly from the Administrator account), and it doesn't seem to cause any issues with the official parts libraries. I suspect it is probably, as Roland mentioned above, that there is a glitch in the handling of the unofficial parts in MLCad that wasn't written in a way 100% compatible with UAC.

But it's not an issue for me any more anyway - a) because I've found my 'fudge' way of fixing it by putting the parts into the official library folders, but more importantly, b) because I'm now a complete convert to LDCad :sweet:

Share this post


Link to post
Share on other sites
33 minutes ago, Jon61 said:

But it's not an issue for me any more anyway

And that is the most important thing and all what counts!

(I'll stick with MLCAD - and will do when the Microsoft people allow me to do so :innocent2:. Never change a running system ... I know, that's what all lazy old farts claim from time to time :pir-huzzah2:)

Glad that LDCad works out for you!

Have fun and all the best,
Thorsten

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.