Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

2 Pages<12
Options
Go to last post Go to first unread
Offline Razonar  
#21 Posted : 03 January 2025 12:55:44(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,533
Uruguay

Was thanked: 989 time(s) in 618 post(s)
Hi Franco. Thanks, but exceptional is SMath in general, and XYPlot plugin in particular. Hope these notes can help to read the procedure for drawing text in this way.

XYPlot - bitmapped fonts some notes.sm (73kb) downloaded 9 time(s).

XYPlot - bitmapped fonts some notes.pdf (399kb) downloaded 8 time(s).

Best regards.
Alvaro.
thanks 1 user thanked Razonar for this useful post.
on 03/01/2025(UTC)
Offline B_Jack  
#22 Posted : 03 January 2025 22:11:54(UTC)
B_Jack


Rank: Advanced Member

Groups: Registered
Joined: 16/04/2023(UTC)
Posts: 38
Italy
Location: Rome

Was thanked: 12 time(s) in 9 post(s)
Thanks really a lot Alvaro for this supplement of informations/details on how works your program/functions and for the time spent in preparing these notes, I really appreciate; I'll study them carefully in the next days/week because I wonna understand in details how it works.

Thanks again and best regards

Franco

Edited by user 03 January 2025 22:15:33(UTC)  | Reason: Not specified

thanks 1 user thanked B_Jack for this useful post.
on 04/01/2025(UTC)
Offline B_Jack  
#23 Posted : 06 January 2025 01:07:45(UTC)
B_Jack


Rank: Advanced Member

Groups: Registered
Joined: 16/04/2023(UTC)
Posts: 38
Italy
Location: Rome

Was thanked: 12 time(s) in 9 post(s)
Alvaro, Oscar,

I am going ahead in the Callout project but I have reached a critical point and I am struggling hard ..but do not find a possibility to progress and complete it as I would like.
I was able to create the callout drawing, to word wrap the text in different rows and to convert the rows in BMP strings and to store them in a vertical array ( Alvaro I didn't create a block with all these rows merged togheter as in your program I decided to keep them split ) .
Now i need to apply the instructions to draw them in the XY Plot Region ...and here comes the troubles.
I am not able to create a loop to do this because in this type of instruction :

XYPlotBMP1.png

the image file/name ( i.e. "image:{BMPxCallout1}" )can't be retrived from an array of images and I can't write directly "el(TxtxCallout,i_rows)" , (sorry but I don't know how to write the corresponding indexed variable in this post so I left the internal representation ) but I need to transit through the assigment of that element to a variable not indexed.

I am running through the posts related to creating traces in a loop from Oscar and Martin ..but I am not able to cume up with a solution/workaround .

Any suggestion will be highly appreciated; thanks in advance for any help, take care and best regards.

Franco

Herewith the files I am working actually, you can see the terrible ways used to draw/test something

XYPlot - Callout_with_Scalable monospaced BMP fonts.sm (2,144kb) downloaded 2 time(s). SubmtrxChrRef.xlsx (14kb) downloaded 1 time(s).

Offline Razonar  
#24 Posted : 06 January 2025 06:56:42(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,533
Uruguay

Was thanked: 989 time(s) in 618 post(s)
Hi. This could be a way.

SubmtrxChrRef.xlsx (24kb) downloaded 6 time(s).

XYPlot - Callout_with_Scalable monospaced BMP fonts.pdf (734kb) downloaded 10 time(s).

XYPlot - Callout_with_Scalable monospaced BMP fonts.sm (2,101kb) downloaded 8 time(s).

Best regards.
Alvaro.
thanks 1 user thanked Razonar for this useful post.
on 06/01/2025(UTC)
Offline B_Jack  
#25 Posted : 06 January 2025 23:30:18(UTC)
B_Jack


Rank: Advanced Member

Groups: Registered
Joined: 16/04/2023(UTC)
Posts: 38
Italy
Location: Rome

Was thanked: 12 time(s) in 9 post(s)
Alvaro thank you very much indeed for your help and all the other valuable informations in the excel file re-attached to yout post .
I have had always the illusion to be a Lotus 123 and then a MS Excel superuser ...but I was never aware of the camera tool so have been shocked to see it applied in your spreadsheet.

Moreover to tell the truth I have tried by myself to play with the concat and the str2num a num2str commands feeling that using these commands there was the possibility to solve the issues that I was facing ..but I started to think too much; the desire was to create a variable name (continuouly changing with an index) on the left side of an assignment expression and assign to it the content of an indexed variable . You see herewith the initial attempts but I give up quite soon seeing errors from Smath ( but obvously it was a fault of mine due to my ignorance )
BadAttempt.png

However now thanks again to your help will try to arrive at an initial release for the Callout project/functions hopefully.

Take care and best regards.

Franco
Offline oscampo  
#26 Posted : 07 January 2025 01:44:14(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 289
Man
Colombia
Location: Cali, Colombia

Was thanked: 124 time(s) in 83 post(s)
Originally Posted by: B_Jack Go to Quoted Post
... to create a variable name (continuouly changing with an index) on the left side of an assignment expression and assign to it the content of an indexed variable...

Franco


Hi Franco, for assign values to indexed variables you need to use the function el(VECTOR,INDEX) which references an element of a VECTOR by its INDEX. Further steps is management of strings to num and viceversa:



in This Way you will have a Vector called BMPCallout with many indexes as you want and each element has assigned a value.

Another way is to create individual variables ( BMPCallout1, BMPCallout2, ... ) in this way:



on each case, the DummyVar is neccessary to evaluate the conversions between strings and numbers

Best,
Oscar
thanks 1 user thanked oscampo for this useful post.
on 07/01/2025(UTC)
Offline B_Jack  
#27 Posted : 07 January 2025 03:08:19(UTC)
B_Jack


Rank: Advanced Member

Groups: Registered
Joined: 16/04/2023(UTC)
Posts: 38
Italy
Location: Rome

Was thanked: 12 time(s) in 9 post(s)
Oscar ,

thanks a lot - as usually - for the examples and the clarity of the explanation.

Best regards

Franco
thanks 1 user thanked B_Jack for this useful post.
on 07/01/2025(UTC)
Offline B_Jack  
#28 Posted : 19 January 2025 23:04:19(UTC)
B_Jack


Rank: Advanced Member

Groups: Registered
Joined: 16/04/2023(UTC)
Posts: 38
Italy
Location: Rome

Was thanked: 12 time(s) in 9 post(s)
Alvaro,Oscar,

are many weeks that I am going ahead to complete the Callout project , I was able to position correctly the text on both type of Callout I am working on for now ; the one where I place directly the text above and/or below the Callout orizontal line and the other one where the text is enclosed in a rectangle drawn at the end of the Callout orizontal line.
I have placed some limits to te drawing possibilities (i.e. the maximum number of the callout text rows is 8 now).
The only problem that I am struggling to resolve since many weeks is that I am not able to pack all the functions that I have developed in a final container function that i have called CreateCallout.
_Correct.png

_wrong.png
The only thing I am sure about is that it must be a very stupid thing that I am missing but have done all the possible attempt to understand without succeeding and I have lost mental clarity for further investigation ( I have read several time the document from Davide too , that is really super-detailed about user defined functions ).

Please can you give a look -when you have time- to the attached worksheet to see were I am wrong ?

Thanks in advance for your help, best regards

Franco

P.S. During this attempt to develop something helpful I have developed some questions too. The main one is the following :

1- After a step of importing external data from an Excel file ( or from a .bmp file for instance a set of fonts ) is it possible later on to break this link and keep these data forever stored in a variable and remove the importing instructions ?
I am asking for this because in a file from Oscar I see that the Arial font data are natively in the worksheet and not imported as I was supposed to think ..and because I would like to add a few other fonts that can be helpful to my workseet so that other people that need to create callout or something similar with an AUTOCAD like style writing have the font available to do this; moreover it would be nice to have everything needed for the Callout drawing in a file avoiding to link the main file to other external bits and pieces of data.

XYPlot - Callout_with_Scalable monospaced BMP fonts_Style1.sm (1,246kb) downloaded 7 time(s). SubmtrxChrRef.xlsx (14kb) downloaded 4 time(s).
Offline Razonar  
#29 Posted : 22 January 2025 07:58:33(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,533
Uruguay

Was thanked: 989 time(s) in 618 post(s)
Hi Franco. I guess that the problem is that the image tag {img} must be at the worksheet level. Please check the note at the right margin in the file from this post: https://en.smath.com/for...ot-Region.aspx#post86128

Images are matrices. You can unlink them from the file showing the matrices with an evaluation, x = ..., expanding the view to the entire matrix, and making a further assignation with x : ... with the most valuable code in windows: copy and paste.

Best regards.
Alvaro.
thanks 2 users thanked Razonar for this useful post.
on 22/01/2025(UTC),  on 22/01/2025(UTC)
Offline B_Jack  
#30 Posted : 24 January 2025 07:59:26(UTC)
B_Jack


Rank: Advanced Member

Groups: Registered
Joined: 16/04/2023(UTC)
Posts: 38
Italy
Location: Rome

Was thanked: 12 time(s) in 9 post(s)
Hola Alvaro,

have tried to read carefully your notes at the top-right of your file and all the remaining parts but due to my ignorance I didn't understand it as I would like but I belive in what you say and because you are a master of the nobile art of workarounds ... it means that in this case none exist.Sad

Unlukily are several months that I'm seeing that programming is less and less a deterministic activity and more and more a mystical experience and I thank Smath Studio for these new directions ( I am kidding obviously ....but not too much and hope that I don't hurt anyone by expressing myself this way , it is just a little bit of irony ).

I can only hope that UNI Help will be able in the future to address this issue because it is very frustrating that you have 2 variables with the same content and you can plot in the XY Plot area just the one that is not the output from a function.

I will continue for other weeks to Wallbash trying to solve this hopefully ( just an illusion but we live of this )

Thanks again for your help and best regards

Franco
thanks 1 user thanked B_Jack for this useful post.
on 25/01/2025(UTC)
Offline oscampo  
#31 Posted : 25 January 2025 05:06:58(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 289
Man
Colombia
Location: Cali, Colombia

Was thanked: 124 time(s) in 83 post(s)
Hi Franco
Finally I have a time to check your file and here are the answers and solutions to your questions.

In the attached file...
1. I explain how to obtain the "Arial Matrix" using the magical recipe "copy and paste" Biggrin
2. How to deal with local variable defined inside a function and pass it to the "worksheet level" (as mention Alvaro)

All my answers and commentaries are in yellow font and black background

My best wishes,

Oscar


*** WARNING *** Try to follow all the commentaries inside this file could be overwhelming

ANSWERS - XYPlot - Callout_with_Scalable monospaced BMP fonts_Style1.sm (1,257kb) downloaded 7 time(s).

Edited by user 25 January 2025 05:34:11(UTC)  | Reason: Not specified

thanks 2 users thanked oscampo for this useful post.
on 25/01/2025(UTC),  on 25/01/2025(UTC)
Offline B_Jack  
#32 Posted : 25 January 2025 07:27:19(UTC)
B_Jack


Rank: Advanced Member

Groups: Registered
Joined: 16/04/2023(UTC)
Posts: 38
Italy
Location: Rome

Was thanked: 12 time(s) in 9 post(s)
Thanks again Oscar for your answer and for all the details in your explanation. I really appreciate.
I try now to describe what I guess I have understood for your confirmation.
It is clear that when a variable is created in a user defined function it is not available outside the function itself ( except if it is one of the outputs of the function itself ).
It exists only whithin the function and I can use it in the function to create other variables and this is what happens when i create the variable dummy and the one used as an output of the function CreateCallout i.e. CalloutStr.
The critical part is in CalloutStr if I check its contents I see that it is equal to the content of the variable generated NOT using a function; this means that in this last variable to the symbolic variable name BMPxCallout1 are however linked real data ( the BMP matrix ) while for the variable CalloutStr ( output of the function ) to the variable name BMPxCallout1 is NOT replaced at runtime the real data that are behind its name and to renable this link I need to read the data from an external file where previously I have saved it ( and obviously the reading instruction MUST be outside the function itself ) at the worksheet level)

...Am I a little bit close to what is happening or as usually I have understood nothing ? Wallbash

However it is as we say in Italian ...a mental masturbation even because -lukily- this amplified side effect doesn't happen always but just when we use the instructions to display a picture/image in the XY Plot plugin ( or not ?).
The thing however that make me wonder the most is how did you understood this ? by experinece, with tons of trial and error an problem solving , with a particular wizardy ..but it is better to live a mystic aurea to the whole.OK

Thanks again and best regards to you all that make this forum realy a top rated one.

Franco

Edited by user 25 January 2025 07:47:03(UTC)  | Reason: Not specified

Offline oscampo  
#33 Posted : 25 January 2025 09:14:45(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 289
Man
Colombia
Location: Cali, Colombia

Was thanked: 124 time(s) in 83 post(s)
Ok Franco. You are getting the idea.
Te best way to understand and realize things like those ones is read the documentation and stay alert to this forum. There are many interesting topics and discussions and you can learn new things from people working on different problems and projects.
In fact, some monts ago I learned another way to redefine worksheet vars from functions, (please check this post)

So when you apply this technique you can solve your problem in a more elegant way, as I show in the following file.

ANSWERS - Another Way.sm (1,257kb) downloaded 8 time(s).


Regards,
Oscar

Edited by user 25 January 2025 09:24:43(UTC)  | Reason: Not specified

thanks 2 users thanked oscampo for this useful post.
on 25/01/2025(UTC),  on 25/01/2025(UTC)
Offline B_Jack  
#34 Posted : 26 January 2025 02:27:39(UTC)
B_Jack


Rank: Advanced Member

Groups: Registered
Joined: 16/04/2023(UTC)
Posts: 38
Italy
Location: Rome

Was thanked: 12 time(s) in 9 post(s)
Jesus help me,Confusion
Oscar I have seen yesterday just the top part of your answer in the file you attached but probably have problem with my sight/concentration and I didn't notice the + at the level of the function definition ... so I was wondering about what you were meaning with definition , ecc, ecc and output when you define a function; this is what I thought I had already done previously.
Only after enlarging the picture in the message of Kenny and reading other 5-6 times all the thread and your last workseet for the n-th time I have finally understood ...this morning better late than never ( probably this morning my brain is switched on and hopefully will remain in this status for few hours and I have to take advantage of it)Unsure .

Thanks again and best regards

Franco
thanks 1 user thanked B_Jack for this useful post.
on 26/01/2025(UTC)
Offline B_Jack  
#35 Posted : 29 January 2025 04:42:47(UTC)
B_Jack


Rank: Advanced Member

Groups: Registered
Joined: 16/04/2023(UTC)
Posts: 38
Italy
Location: Rome

Was thanked: 12 time(s) in 9 post(s)
Hi Team,
after a long time I guess that I was able to develop a 1st release of the Callot project that I attach herewith. XYPlot - Callout_with_Scalable monospaced BMP fonts_Ver1.sm (1,826kb) downloaded 0 time(s).
I hope that this can be of any help for someone who needs to add callouts to drawings.
The shape of this release is not what I would like and I plan to add the following:

0-Add the trasparency in each row of text as shown in an Alvaro's example about this issue.

1-Add the BMP fonts available in the file of Alvaro and some additional ones similar to the style of a text in Autocad (need to check where I can find them because there aren't in Excel)

2-Check if make sense do not introduce the coordinate of the arrow part of the callout as arguments of the final function used for their drawing ( I guess that is not a very good idea )

3-Moreover I would like to minimize the Inputs for the creation of a callot using the method seen in some examples from UNI related to Shapes drawing ( basically defining defaults that can optimize the graphical look of the callout so that if some inputs are missing these defaults are used )

Again I would like to acknowledge the enormous help of Alvaro and Oscar who with their examples and suggestions allowed me to move forward with this project(probably the word project is too important for what I did that is something very modest).

Last thing is related to the copy and past technique use to store a font matrix ( or other data ) in a worksheet avoiding to retrive these data each time from an external data file.
Now the procedure explained works ..but not in a nice way ; I mean that if I have a huge matrix of data read from an external Excel file for instance I see that this matrix is displayed with 3 dots at the bottom that allow to see the matrix in a collapsed way . The problem rises when I want to copy the content of this matrix in another variable . First this is NOT possible if I don't expand all the matrix so that I can see and select ALL the data that are stored in it . Second most annoying thing is that after the copy and past in the new storage variable it is no more possible to collapse the structure of the matrix using the 3 dots and I must see it as a whole forever .
My personal opinion is that this behaviour is not correct and that it is very similar to a bug.

For what concern the callout function I am obviosly available for any suggestion for improvements and to critics or requests for clarification ( I tried to document as much as possible the main variables/parameters used but this was based on my personal point of view )

Best Regards

Franco

Offline B_Jack  
#36 Posted : 05 February 2025 07:03:08(UTC)
B_Jack


Rank: Advanced Member

Groups: Registered
Joined: 16/04/2023(UTC)
Posts: 38
Italy
Location: Rome

Was thanked: 12 time(s) in 9 post(s)
Hi Team,

have attached herewith a new release of the create callout functions where I tried to add the features described in my previous post, so:

0-Add the trasparency effect to the text placed on the XY area using the Alvaro's method (which I call "Ink jet" method). This is a very interesting and intelligent technique in which only non-white pixels are displayed but applying it to a long text string has been proven to be unfeasible because the worksheet execution times increase too much.

1-Add more fonts from the Alvaro's file and some additional ones with a "Technic" style.It is now possible to select a font from the 9 ones listed herewith.

FontList.png

the files (.png) with each font data are zipped here FontsDataFile.zip (45kb) downloaded 2 time(s). and each font can be selected in the worksheet in this way

FontSelection.png

These files must be unzipped into a directory along with the following workseet XYPlot - Callout_with_Scalable monospaced BMP fonts_Ver1_3S.sm (2,317kb) downloaded 1 time(s)..
It has not been possible to embed the content of all these external files in the worksheet ( as initially desired ) because again its execution times increase too much.

2-Adding the coordinate of the arrow part of the callout as arguments of the final function used for their drawing . Done

3-Moreover I would like to minimize the Inputs for the creation of a callot using the method seen in some examples from UNI related to Shapes drawing ( basically defining in this way a set of default arguments that can optimize the graphical look of the callout itself and speedup its creation ). Done

For what concern this last point I have the following question. Is it possible in a user defined function that has for instance 7 arguments ( see herewith what I have done for the CreateCallout function in the worksheet attached )
Defaults.png

define a default in a central position but NOT beeing obliged to accept already all the defaults related to the arguments at its right ??
I mean if I wonna define that the default just for the argument FontFamily is Arial and for all the other arguments at its right I am free to place whatever I want; how can I write the expression of the user function ?
Or this is not possible to accomplish and simply I must define in the function body at the beginning (usually) that if the argument of FontFamily is "-" or something else that I have pre-defined in advance and that means a default value for the argument in that position I will consider Arial as the FontFamily passed value . Hope that I was able to explain this issue quite well .

Thanks in advance for any help and best regards

Franco

P.S. Herewith some usage examples, they aren't done with the last release of the worksheet, other examples screenshot are in an area at the bottom part of the worksheet

_Example1.png
_Example2.png
_Example3.png

Edited by user 05 February 2025 20:29:26(UTC)  | Reason: Added examples

thanks 3 users thanked B_Jack for this useful post.
on 05/02/2025(UTC),  on 05/02/2025(UTC),  on 08/02/2025(UTC)
Users browsing this topic
2 Pages<12
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.