News:

All posts discussing pricing or where to buy TurboCAD will be deleted.

Main Menu

Date/time stamp

Started by tamhas, April 26, 2021, 07:38:01 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

tamhas

In my Excel spreadsheets, I often include a cell with the @today() function so that whenever the sheet is printed, the current date (and time, if appropriate) is displayed so that one knows which is the most recent printout.  Is there any similar capability in TurboCAD Pro ... presumably in paper space?  I couldn't find anything in the manual.
Thomas Mercer-Hursh, TC Pro 15

Alvin Gregorio

#1
Attached is a test-run, having inserted an "Object" into TurboCAD, that object being an Excel Spreadsheet, the "Create New" option, edited and editable within TurboCAD-- without leaving TurboCAD to go to Excel.

I will open this .tcw Drawing File tomorrow, and see if and how it updates.

Note:  I inserted into Paperspace, and copied/pasted into Modelspace, just for ...

It's version 2020, created using the Platinum edition.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

tamhas

Inserting an entire Excel sheet seems like an awfully brute force approach to merely getting the current data and time on print outs.   Even with the Excel sheet, would the function execute at print time or only show the data as of the last update?
Thomas Mercer-Hursh, TC Pro 15

Don Cheke

#3
You could try this, although I haven't checked to see if it works since I first wrote the TC Tip (version 17)

http://www.textualcreations.ca/TurboCAD%20Tips/TurboCAD%20Tip%203.pdf

EDIT: It still works, although I had to use the search function to find the date and time function. Wasn't apparent on the Insert ribbon.

It can be a bit finicky but you can get used to how it works pretty quickly.

You can also make it part of your template, so it is always available.
Don Cheke
My Blog: One Man's Meanderings

tamhas

Seems weird to have to use Word, but that looks promising.  It may be tomorrow before I have a chance to try it out.
Thomas Mercer-Hursh, TC Pro 15

tamhas

Don, worked like a champ and my compliments on a clear set of instructions!  I wish I didn't have to manually trigger an update, but I can manage.  THANKS!
Thomas Mercer-Hursh, TC Pro 15

Don Cheke

Quote from: tamhas on April 27, 2021, 01:33:36 PM
Don, worked like a champ and my compliments on a clear set of instructions!  I wish I didn't have to manually trigger an update, but I can manage.  THANKS!

You are welcome Thomas, I am glad it will work for you.
Don Cheke
My Blog: One Man's Meanderings

Alvin Gregorio

#7
Yes, a Word object is a bit less clunky than an Excel object.
__
We can make the inserted date/time Word object a Block, thereby updating it across multiple Paperspace sheets simulatenously, via having "Edit"ed it once via Edit Block Content.
___
A side note:  In my TC v2020/Platinum, after having inserted the Word or Excel object, my Modelspace and Paperspace tabs at the bottom of the drawing space somewhat disappear.  I can live with that; but I thought I'd just call it to attention, so that no one is surprised if and when it happens.  If I click in the area I know the tabs are, they appear for an instant, and I can catch them to click on one; or I can switch Drawing spaces via some other method.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

nikkipollard

#8
It seems like such a simple thing that could be added to the print dialog.
I use a Database for a title block
Which uses a microsoft access file to communicate with block attributes. Access also has a now function.
And linking to to the data base can be painful.
But you would also need to update that every time you printed.
Alternatively you could run the date and time stamp script in ruby - just before you print.


Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Torfinn

I use Titelfields from Viewports, so easy to set the date on all before print, and i don't need to mess with Word or Excel to update the date
Of course not automatic then ;), but i don't always want to change date just for a reprint in example, so ....

Torfinn
V20, V21, 2015 > 2024  Platinum
Deluxe 2015/ 16/ 19
RedSDK enabled
Windows 10 Home Premium (20H2/ 19042.1083) 64 bit, 32 GB
NVIDIA Geforce GTX 780m, 1 GB

Henry Hubich

The Ruby Console offers "TC Add Timestamp" (see attached screenshot). Simply click on its name in the list; do not click "Execute." When the little dialog box opens, type the desired text height in the upper box and click "Draw timestamp." In Paperspace, the stamp might be placed outside of the actual paper, but it can easily be moved to wherever you like.

Henry H

nikkipollard

I think that is the best way to go.
You can edit the script so that you don't need to move the stamp every time.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Henry Hubich

#12
Quote from: nikkipollard on April 29, 2021, 04:03:39 AM
I think that is the best way to go.
You can edit the script so that you don't need to move the stamp every time.

How, Nikki?

Henry H

P.S. Never mind; I've got it.

Andy H

#13
Quote from: nikkipollard on April 29, 2021, 04:03:39 AM
I think that is the best way to go.
You can edit the script so that you don't need to move the stamp every time.

No need to edit script.  Simply type in the x /y coordinates in the form that appears.  something like 218 and 26 for bottom right of an A4 landscape page. 

That said.  Many would want to alter the scrip to get the date / time format how they want it (do people really write in the time down to the last second). 

Whilst I'm commenting....  Also could do with extra controls in the form to auto replace one or more timestamps. Without having to delete them and re-inset them.  Probably using a list box to select whatever paper spaces are being printed.   A drop down box to select the required date format would be nice.   That's for anyone who fancies doing some programming  ;D

nikkipollard

#14
I was thinking of using a bounding box to get the extents of the active paper space.
Or the page setup property - if that works
position the time stamp relative to that.
But it might be easier to change the default values in the text boxes.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Jeff_in_90620

Quote from: nikkipollard on April 29, 2021, 11:51:36 PM
* Screenshot 2021-04-30 084353.png (32.87 kB, 615x494

That is a lot of programming to get a timestamp where you want it.

Seems to me, a higher-level solution would be useful.  Can this mini-program be saved as a Macro that can be loaded into different files?


Jeff
Jeff

TC 2026 Pro Platinum plus 2015->2024 (most with LightWorks & RedSDK) & V21
System: AMD Ryzen 9 7950X, MSI Mag X670E Tomahawk WiFi, 64GB RAM @ 4.80GHz, ARC A770 w/16GB, 3 x Samsung NVMe 990 (1TB), Windows 11 Pro (64-bit)

nikkipollard

#16
I don't know it's the example ruby that Kevin Chapman wrote.
it can be used anywhere it is in Ruby
the only reason I suggested editing the script , is because we tend to use a standard size title block and
at a scale 1: 1 so you can change the position of the stamp without having to move it every time.
I think the majority of the script is the dialogue box.
Using the Macro is much simpler because you cant have a dialogue box.
But then you have to reinvent the wheel.

If you were talking about my suggestion of using a bounding box - being a lot of extra programming.
Not really.. It's literally 4 lines of coding. And you would never have to type the position in.

Option Explicit

Dim TcDraw
Dim Gsel

Call Main

Set Gsel = Nothing
Set TcDraw = Nothing

'_______________________________________________________________________________
Sub Main

Set TcDraw = ActiveDrawing
TcDraw.SelectAll
Set Gsel = TcDraw.Selection

Dim maxx, miny,bound, gfx
Set bound = Gsel.CalcBoundingBox
maxx = bound.Max.x + 1
miny = bound.Min.Y + 2

Dim Day : Day = Now
Dim Name : Name = TcDraw.path

Set gfx = TcDraw.Graphics.AddText(Name & "     " & Day,maxx,miny,0,2)
gfx.Properties.Item("TextFormat").Value = 257
gfx.RotateAxis 1.5707963267949, 0, 0, 1,maxx, miny, 0
gfx.Layer = "0"

TcDraw.UnselectAll
TcDraw.ActiveView.Refresh

Set gfx = Nothing

End Sub


Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Henry Hubich

In my installation, x=0 and y=o corresponds to the bottom left corner of my "Portrait" Paperspace. I've edited the Ruby script to replace the expressions for "x" and "y" with specific values (see the first attachment, below) to place the timestamp near the bottom left corner (second attachment).

Henry H

Marek

#18
Hi
I am attaching a modified script.
1. The script is invoked with name = ts
2. You should indicate the stamp insertion point with the mouse
3. The x, y cordinates indicated by the mouse are displayed in the opened window (you can manually modify them or leave them)
4. Click on "Draw timestamp"
Marek

Edit
Instead of the * .rb file, I attach the * .txt file.
The file can be opened e.g. in Notepad ++ or other notepad, saved as * .rb (or change the extension from txt to rb) and placed in your RubyScripts folder.


Note - The script has been removed. Corrected script posted in this thread below.
Marek

TC Pro 2016, TC Pro 2018, TC Plat 2019,TC Plat 2020,TC Plat 2021,TC Plat 2022,TC Plat 2023,TC Plat 2024, TC Plat 2025
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit

nikkipollard

Thank you for sharing Marek.
I have been trying to work out how to get a mouseclick in Ruby scripts.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Marek

Cool, Nikki. I'm glad if it helped you a little.
Marek
Marek

TC Pro 2016, TC Pro 2018, TC Plat 2019,TC Plat 2020,TC Plat 2021,TC Plat 2022,TC Plat 2023,TC Plat 2024, TC Plat 2025
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit

Dean

Quote from: Marek on May 01, 2021, 07:23:22 AM
Hi
I am attaching a modified script.
1. The script is invoked with name = ts
2. You should indicate the stamp insertion point with the mouse
3. The x, y cordinates indicated by the mouse are displayed in the opened window (you can manually modify them or leave them)
4. Click on "Draw timestamp"
Marek

Edit
Instead of the * .rb file, I attach the * .txt file.
The file can be opened e.g. in Notepad ++ or other notepad, saved as * .rb (or change the extension from txt to rb) and placed in your RubyScripts folder.

Hi Marek,
I am getting script error > see attached video
if it works first time try it again.
"What do I know, I'm still learning".
Lenovo Legion T5  Intel(R) Core(TM) i7-14th Gen 20 cores Nvidia RTX 4070 Super 16GB Windows 11 home TurboCad 2025 with Animation Lab 6.0

Marek

#22
Hi Dean.
I cannot repeat this error. I tried English units, different scales and the problem does not appear. Maybe attache this * .tcw file.
Marek

P.S.
I tried 10 times, again and again, using "Execute" or "Enter".
Marek

TC Pro 2016, TC Pro 2018, TC Plat 2019,TC Plat 2020,TC Plat 2021,TC Plat 2022,TC Plat 2023,TC Plat 2024, TC Plat 2025
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit

Alvin Gregorio

#23
Quote from: Dean on May 02, 2021, 06:28:40 AM
...

Hi Marek,
I am getting script error > see attached video
if it works first time try it again.

Works fine for me.  Then again, I'm not inserting the script object the way you are-- typing "ts" in the lower pane of the Ruby Console.  I'm using the drop-down field-box to select "TC Add Timestamp".  [Edit]:  Replicated issue Dean reported
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Marek

Quote from: Alvin Gregorio on May 02, 2021, 07:18:56 AM
...
I'm using the drop-down field-box to select "TC Add Timestamp".

If that's more convenient for you.  :)  It seems to me that it is faster my way. Therefore, I try to keep the names of the functions as short as possible.
Marek
Marek

TC Pro 2016, TC Pro 2018, TC Plat 2019,TC Plat 2020,TC Plat 2021,TC Plat 2022,TC Plat 2023,TC Plat 2024, TC Plat 2025
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit

Alvin Gregorio

#25
Admittedly, these inserted ts Ruby Script objects do not get included in the Zoom Extents or Select All.
Though the are listed in Selection Info Palette (All)

Nor are they listed in the Undo list.

Running an Audit Report, it appears that they are being inserted to far from 0,0,0
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

#26
An example of the issue Dean reported being replicated:

>Drawing is Metric
>type "ts", and Exectute
>as prompted, "Define first corner of view", I Vertex Snap to a previously inserted Point Object, that is at X=40.0, Y=-30.0
>in the script pop-up window, I enter 40.0 for the X Coordinate, and -30.0 for the Y Coordinate; I add the Optional Text #4; X=40.0; Y=-30.0
>Click on "Draw timestamp"
>That object inserts at X=400mm; Y=-300mm

I am confident that Marek can give this a quick fix.  Perhaps the script cannot handle decimal points values correctly.  [Edit, including the Bold to the left]:  Yes, it is an issue with the decimal point values.  The script is not recognizing the decimal.  For instance, an X value clicked and entered in the X Coordinate field of 30.1253456, inserts in the drawing space at 301253456.000
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

#27
I see what's going on in the script.  (it lies in this part of Marek's modification to the script, I believe; see screen-snip below)
It's the decimal separator being a comma, and our setup not being set up for commas.  I'm guessing that Marek's is set up for commas.

We an manually change the decimal separator commas to periods, in the insert_script_object's pop-up window and it will work.

Or maybe Marek or someone (maybe even me?) can change the script to automatically change to commas or periods per user's settings.

There needs to be some sort of If|Then right here, I believe:

        ...
        tx.gsub!(".",",")
        ty.gsub!(".",",")
        ...
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Marek

#28
Hi Alvin
Here a lot depends on the regional settings of the system. For me, the decimal separator is a comma. If I enter a dotted value in the text field, I will get the message "invalid input string format". I then replace "." to "," and it's OK. I fixed v2 so that if you enter a value with a dot, the script will convert it to a value with a comma. I don't know how it will work for you. Correctly, you should read what is the separator in  system, and then adapt to it. But it's a simple script. There is no error handling other than what the system catches.
Marek

Note - The script has been removed. Corrected script posted in this thread below.
Marek

TC Pro 2016, TC Pro 2018, TC Plat 2019,TC Plat 2020,TC Plat 2021,TC Plat 2022,TC Plat 2023,TC Plat 2024, TC Plat 2025
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit

nikkipollard

#29
I am sure we can just delete the conversion.
If you are not converting the comma do you need to convert the coordinate to a string before setting it as the text box value?
I usually type numbers in text boxes on windows forms.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Marek

#30
 But if I want to be able to enter data manually in text fields, without converting,I get the error "can't convert Float into Symbol". The problem is that we want the script to work with both the dot and the comma decimal separator.
Marek
Marek

TC Pro 2016, TC Pro 2018, TC Plat 2019,TC Plat 2020,TC Plat 2021,TC Plat 2022,TC Plat 2023,TC Plat 2024, TC Plat 2025
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit

nikkipollard

I understand that
It is easy enough to comment your substitution out if it is causing problems.
Is it possible to check the computers regional settings with Ruby and code to suit those settings?
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Henry Hubich

#32
Why would anyone want to enter anything other than an integer value?

Henry H

EDIT: Silly question.

nikkipollard

being able to pick a point on the screen is a lot easier then typing values in text boxes. The problem is with the regional settings for a delimiter. Marek's version lets you select a point on the screen and automatically changes the text boxes. it then changes the values to allow for a comma delimiter = this causes problems if your system has a point delimiter instead of a comma.
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Marek

Quote from: nikkipollard on May 03, 2021, 04:51:56 AM
Is it possible to check the computers regional settings with Ruby and code to suit those settings?

I haven't tried it yet, but I'm going to try it.
Marek
Marek

TC Pro 2016, TC Pro 2018, TC Plat 2019,TC Plat 2020,TC Plat 2021,TC Plat 2022,TC Plat 2023,TC Plat 2024, TC Plat 2025
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit

Henry Hubich

Quote from: nikkipollard on May 03, 2021, 10:36:29 AM
being able to pick a point on the screen is a lot easier then typing values in text boxes. The problem is with the regional settings for a delimiter. Marek's version lets you select a point on the screen and automatically changes the text boxes. it then changes the values to allow for a comma delimiter = this causes problems if your system has a point delimiter instead of a comma.

If the mouse click thinks that a non-integer value of the screen position has been selected, why not simply ignore all but the integer part of the number? Then--I think--it becomes irrelevant whether one's system uses dots or commas as delimiters.

Henry H

Marek

Hi Henry
You can do that in such way , too. You can also replace the comma with the dot in text field. But this is why you click the mouse, so that you do not have to enter anything in the text box. Sometimes you want to insert a stamp in a specific place.
Marek
Marek

TC Pro 2016, TC Pro 2018, TC Plat 2019,TC Plat 2020,TC Plat 2021,TC Plat 2022,TC Plat 2023,TC Plat 2024, TC Plat 2025
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit

Alvin Gregorio

#37
Quote from: Henry Hubich on May 03, 2021, 11:01:39 AM

If the mouse click thinks that a non-integer value of the screen position has been selected, why not simply ignore all but the integer part of the number? Then--I think--it becomes irrelevant whether one's system uses dots or commas as delimiters.

Henry H

Such as in your earlier posted example Henry, you had .5 for the X position.  You can imagine if in a Letter-sized or ArchD-sized-- or many sizes-- Paperspaces how non-optimal it would be if one were limited to integer values only for this Date/Time stamp location.  Particularly if one wants it in the "margin" of the paper print, just inside the printer's allowable margins.  If one's Space Units for Paperspace is inches, mostly.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Marek

Quote from: Marek on May 03, 2021, 10:41:24 AM
Quote from: nikkipollard on May 03, 2021, 04:51:56 AM
Is it possible to check the computers regional settings with Ruby and code to suit those settings?

I haven't tried it yet, but I'm going to try it.
Marek

Nikki, you can try what the attachment shows in your Ruby console. We have to look further. Perhaps LOCALAPPDATA property.
Marek
Marek

TC Pro 2016, TC Pro 2018, TC Plat 2019,TC Plat 2020,TC Plat 2021,TC Plat 2022,TC Plat 2023,TC Plat 2024, TC Plat 2025
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit

Dean

Quote from: Marek on May 02, 2021, 07:14:22 AM
Hi Dean.
I cannot repeat this error. I tried English units, different scales and the problem does not appear. Maybe attache this * .tcw file.
Marek

P.S.
I tried 10 times, again and again, using "Execute" or "Enter".

hi Marek,
I see what is happening for me.
Using your original script.
> 1st try run script, as I move the mouse in the screen area the X and Y coordinates are moving along in the status bar. Script works ok
> Delete first Time stamp
> 2nd try run script, as i move the mouse in the screen area the X and Y coordinates in the status Bar are frozen. They appear to be locked from the first time stamp so I continue and click in the screen and the coordinates in the time stamp box appear to be putting the stamp in another galaxy. This explains my original error reported. I haven't looked at the script.
"What do I know, I'm still learning".
Lenovo Legion T5  Intel(R) Core(TM) i7-14th Gen 20 cores Nvidia RTX 4070 Super 16GB Windows 11 home TurboCad 2025 with Animation Lab 6.0

Henry Hubich

Quote from: Alvin Gregorio on May 03, 2021, 11:44:13 AM
Quote from: Henry Hubich on May 03, 2021, 11:01:39 AM

If the mouse click thinks that a non-integer value of the screen position has been selected, why not simply ignore all but the integer part of the number? Then--I think--it becomes irrelevant whether one's system uses dots or commas as delimiters.

Henry H

Such as in your earlier posted example Henry, you had .5 for the X position.  You can imagine if in a Letter-sized or ArchD-sized-- or many sizes-- Paperspaces how non-optimal it would be if one were limited to integer values only for this Date/Time stamp location.  Particularly if one wants it in the "margin" of the paper print, just inside the printer's allowable margins.  If one's Space Units for Paperspace is inches, mostly.

You're right of course, Alvin. I wasn't thinking.

Henry H

Henry Hubich

Quote from: Marek on May 03, 2021, 11:34:44 AM
Hi Henry
You can do that in such way , too. You can also replace the comma with the dot in text field. But this is why you click the mouse, so that you do not have to enter anything in the text box. Sometimes you want to insert a stamp in a specific place.
Marek

OK, Marek. I think I've got my thinking straight now.

Henry H

nikkipollard

Quote from: Marek on May 03, 2021, 12:03:56 PM
Quote from: Marek on May 03, 2021, 10:41:24 AM
Quote from: nikkipollard on May 03, 2021, 04:51:56 AM
Is it possible to check the computers regional settings with Ruby and code to suit those settings?

I haven't tried it yet, but I'm going to try it.
Marek

Nikki, you can try what the attachment shows in your Ruby console. We have to look further. Perhaps LOCALAPPDATA property.
Marek

Oh I see the problem I thought it would be something simple like this.
It is easier for the user to just comment out / or delete that part of the script.

https://github.com/carlosantoniodasilva/i18n_alchemy

I am not sure if this would help me anyway because I have changed the setting on my computer because windows got it wrong for our country , we don't use comma delimiter.

Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Marek

Quote from: nikkipollard on May 03, 2021, 11:17:28 PM
Oh I see the problem I thought it would be something simple like this.
It is easier for the user to just comment out / or delete that part of the script.
I am not sure if this would help me anyway because I have changed the setting on my computer because windows got it wrong for our country , we don't use comma delimiter.

I completely agree. Better do not touch our locale , as we may have problems with many programs installed on our computer. Such problems must be solved within a specific program. Simply, you just got me interested in how to get to the system properties in ruby and I shared with you because I can see that you are interested in programming.
Marek
Marek

TC Pro 2016, TC Pro 2018, TC Plat 2019,TC Plat 2020,TC Plat 2021,TC Plat 2022,TC Plat 2023,TC Plat 2024, TC Plat 2025
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit

Marek

#44
Quote from: Dean on May 03, 2021, 12:52:12 PM
hi Marek,
I see what is happening for me.
Using your original script.
> 1st try run script, as I move the mouse in the screen area the X and Y coordinates are moving along in the status bar. Script works ok
> Delete first Time stamp
> 2nd try run script, as i move the mouse in the screen area the X and Y coordinates in the status Bar are frozen. They appear to be locked from the first time stamp so I continue and click in the screen and the coordinates in the time stamp box appear to be putting the stamp in another galaxy. This explains my original error reported. I haven't looked at the script.

Dean, still can't repeat this error. For me, the fields with coordinates do not freeze. I put "tsX.Text = nil tsY.Text = nil" in the code. It should be done anyway. If you like, check the corrected script. I wonder if I need "tcView.ZoomToExtents" in this script. If this bothers someone, he can remove this line of code himself.

Note - The script has been removed. Corrected script posted in this thread below.
Marek

TC Pro 2016, TC Pro 2018, TC Plat 2019,TC Plat 2020,TC Plat 2021,TC Plat 2022,TC Plat 2023,TC Plat 2024, TC Plat 2025
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit

Alvin Gregorio

Quote from: Marek on May 04, 2021, 03:09:37 AM
Quote from: Dean on May 03, 2021, 12:52:12 PM
hi Marek,
I see what is happening for me.
Using your original script.
> 1st try run script, as I move the mouse in the screen area the X and Y coordinates are moving along in the status bar. Script works ok
> Delete first Time stamp
> 2nd try run script, as i move the mouse in the screen area the X and Y coordinates in the status Bar are frozen. They appear to be locked from the first time stamp so I continue and click in the screen and the coordinates in the time stamp box appear to be putting the stamp in another galaxy. This explains my original error reported. I haven't looked at the script.

Dean, still can't repeat this error. For me, the fields with coordinates do not freeze. I put "tsX.Text = nil tsY.Text = nil" in the code. It should be done anyway. If you like, check the corrected script. I wonder if I need "tcView.ZoomToExtents" in this script. If this bothers someone, he can remove this line of code himself.

In response to Dean's Reply:

I believe Dean meant Coordinate Fields, not Status Bar.  For me, once the insertion of the script object is activated, the Coordinate Fields are active, not the Status Bar.

The reason Dean is experiencing that behavior is because once the first instance of the Ruby date/time stamp is placed-- very far away from World 0,0, due to the comma delimiter issue that I "discovered" and Marek has now attended to-- this messes up TurboCAD, as it always does when we have objects WAY TOO FAR AWAY out in space.
To clear the issue, Shift+Tab into the Coordinate Fields and type in something reasonable that TurboCAD can understand and deal with, something with no more or less than a +10 or -10, in scientific notation.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Marek

Dean,
it looks a little different for me, but I already know what's going on. Wait trying the script until I attach a new one.
Marek
Marek

TC Pro 2016, TC Pro 2018, TC Plat 2019,TC Plat 2020,TC Plat 2021,TC Plat 2022,TC Plat 2023,TC Plat 2024, TC Plat 2025
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit

Marek

Hi
I think it will be better this way. Tested for coordinates that are far apart from each other - see attachment(with zoom enabled, use Ctrl + A ,to see the whole area). I used a dot and a comma in the text box and it worked.
Marek
Marek

TC Pro 2016, TC Pro 2018, TC Plat 2019,TC Plat 2020,TC Plat 2021,TC Plat 2022,TC Plat 2023,TC Plat 2024, TC Plat 2025
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit

Dean

Quote from: Marek on May 05, 2021, 05:55:19 AM
Hi
I think it will be better this way. Tested for coordinates that are far apart from each other - see attachment(with zoom enabled, use Ctrl + A ,to see the whole area). I used a dot and a comma in the text box and it worked.
Marek

Hi Marek,
You are the Script Master  :)  works perfectly...
"What do I know, I'm still learning".
Lenovo Legion T5  Intel(R) Core(TM) i7-14th Gen 20 cores Nvidia RTX 4070 Super 16GB Windows 11 home TurboCad 2025 with Animation Lab 6.0

Marek

And you are the BetaTester Master. You will find every error.  :D
Greetings
Marek
Marek

TC Pro 2016, TC Pro 2018, TC Plat 2019,TC Plat 2020,TC Plat 2021,TC Plat 2022,TC Plat 2023,TC Plat 2024, TC Plat 2025
Laptop Asus i7 6500U, dual-core 2,50GHz, NVIDIA GeForce GTX 950M, RAM 12 GB, SSD 480GB
Windows 10 64 bit