[Solved] Uncaught exception ConvertUnit.js

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
CVH
Premier Member
Posts: 3416
Joined: Wed Sep 27, 2017 4:17 pm

[Solved] Uncaught exception ConvertUnit.js

Post by CVH » Tue Aug 30, 2022 7:43 am

Andrew,

With the intention to add US survey units ...
I get an error that I can't place when running Convert.js in debug mode.

Allready converting from mm to inch the code stumbles on:

Code: Select all

156  var s = entity.getDimscale(false); 
Uncaught exception at scripts/Edit/ConvertUnit/ConvertUnit.js:156: Error: : -1: -1: Wrong number/types of arguments for RDimensionEntity.getDimscale().
<native>(false) at -1
<anonymous>(di = RDocumentInterface(0x128a13c8), fromUnit = 4, toUnit = 1) at scripts/Edit/ConvertUnit/ConvertUnit.js:156
<anonymous>() at scripts/Edit/ConvertUnit/ConvertUnit.js:58
<anonymous>(false) at scripts/Edit/ConvertUnit/ConvertUnit.js:250
<global>() at -1


Has it something to do with the recent change to dimStyle ?

Regards,
CVH
Last edited by CVH on Tue Aug 30, 2022 4:52 pm, edited 1 time in total.

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Uncaught exception ConvertUnit.js

Post by andrew » Tue Aug 30, 2022 8:12 am

What version are you on?

Line 156 does not seem to match with the current version:
https://github.com/qcad/qcad/blob/v3.27 ... ertUnit.js

CVH
Premier Member
Posts: 3416
Joined: Wed Sep 27, 2017 4:17 pm

[Solved]: Uncaught exception ConvertUnit.js

Post by CVH » Tue Aug 30, 2022 4:51 pm

andrew wrote:
Tue Aug 30, 2022 8:12 am
What version are you on?
Seems to be a mix .... 3.27.0 and bits and pieces ...
Even with a new copy of the script in question it halts now on line 162 ...

I think it is time that I update QCAD completely and also download the latest master from GitHub as reference.

Sorry about not looking deeper for the obvious cause.

Regards,
CVH

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”