GraphicDesigner Posted August 27, 2020 Share Posted August 27, 2020 Is there a way to create a sequence of a sequence of numbers in Designer? I want to label a custom diagram I'm making. I'd like to be able to change the font and size, so that's why I'd prefer to do it this way rather than importing images from somewhere else. Thanks! Quote Link to comment Share on other sites More sharing options...
v_kyr Posted August 27, 2020 Share Posted August 27, 2020 1 hour ago, GraphicDesigner said: Is there a way to create a sequence of a sequence of numbers in Designer? I want to label a custom diagram I'm making. ... In Affinity, I don't think so. AFAIK there isn't any option for creating sequences of numbers or the like. But you can instead use any scripting language to output some range of number values (it's easy done via loops) as text and then copy that text over into Affinity. Here is a plain simple python example ... def createSeq(seqstart,seqend): # Testing if range seqstart and seqend are equal if (seqstart == seqend): return seqend else: # loop to print successors until seqend is reached. while(seqstart < seqend+1 ): print(seqstart, end = ' ') seqstart += 1 # Driver Code # Setup two vars to build our range seqstart, seqend = -3, 3 # Call and run our above little createSeq(...) function createSeq(seqstart, seqend) ... which when executed outputs ... Quote > python3 createseq.py -3 -2 -1 0 1 2 3 If you change the above "print(seqstart, end = ' ')" into just "print(seqstart)" it will print the given sequence range numbers each on seperate lines (so with newlines) ... Quote > python3 createseq.py -3 -2 -1 0 1 2 3 If you modify the increment statement ("seqstart += 1") inside the while loop to other values, you can influence the number distance output of the range/sequence. NOTE: You can for example also let sequence output be generated in SVG format instead then, so you can afterwards import all sequence numbers at once via a SVG file, in order to have every sequence number as a single positionable number-text layer in Affinity. Generally there are a bunch of possibilities to get/generate number sequences that way and you can basically use any scripting language for such tasks. GraphicDesigner 1 Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2 Link to comment Share on other sites More sharing options...
lacerto Posted August 28, 2020 Share Posted August 28, 2020 (...) GraphicDesigner 1 Quote Link to comment Share on other sites More sharing options...
GraphicDesigner Posted August 30, 2020 Author Share Posted August 30, 2020 Wow, these are excellent suggestions! Thanks a lot. @Lagarto your method is super cool. @v_kyr thanks a ton for the tip! lacerto 1 Quote Link to comment Share on other sites More sharing options...
v_kyr Posted August 31, 2020 Share Posted August 31, 2020 Here is a quick take in Java (thus platform portable), which uses just a plain for-loop in oder to generate a range of output numbers. The loop uses an increment setting for stepping, so you can flexible define number ranges [start, step, end]. public static List<Integer> getNumbersInRange(int start, int step, int end) { List<Integer> result = new ArrayList<>(); for (int i = start; i <= end; i=i+step) { result.add(i); } return result; } Further it allows to place any given string inbetween the numbers as a number delimiter, as also the left and right range boundaries as a string if wanted. So it's easy to generated needed number ranges. Quote > java SeqGenerator You will now have to enter three numbers and strings for the range setup ... Enter the range *start* number value: -100 Enter the range *step* number value: 10 Enter the range *end* number value: 50 Enter a string or use blanks as a number separator: Enter a left range delimiter string or blanks: min Enter a right range delimiter string or blanks: max min -100 -90 -80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 max > java SeqGenerator You will now have to enter three numbers and strings for the range setup ... Enter the range *start* number value: 0 Enter the range *step* number value: 5 Enter the range *end* number value: 100 Enter a string or use blanks as a number separator: - Enter a left range delimiter string or blanks: ( Enter a right range delimiter string or blanks: ) ( 0 - 5 - 10 - 15 - 20 - 25 - 30 - 35 - 40 - 45 - 50 - 55 - 60 - 65 - 70 - 75 - 80 - 85 - 90 - 95 - 100 ) If you have a need for that let me know, then I can provide you the Java code and a precompiled class file or jar file. Though you would need to have at least a Java 8 SE runtime environment installed to execute it. Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2 Link to comment Share on other sites More sharing options...
lacerto Posted August 31, 2020 Share Posted August 31, 2020 (...) Quote Link to comment Share on other sites More sharing options...
Shico Posted November 29, 2022 Share Posted November 29, 2022 I know this is a very old thread, but I just came across it while looking for a similar solution and thought I would suggest another way to do it in case it comes useful to someone. Another quick way to create the numbers sequence mentioned above if you don't want to use scripting is by using Microsoft Excel. Just type the first 2-3 blocks (vertically or horizontally) of how you want the sequence to start (3,2), then select the blocks and drag the selection rectangle from the side and it will fill the rest of the blocks automatically with the numbers according to the same sequence (3,2,1,0,-1,-2...) Then copy the text into Affinity Designer. Quote Link to comment Share on other sites More sharing options...
Old Bruce Posted November 29, 2022 Share Posted November 29, 2022 Thanks for that LondonSquirrel, I really should spend more time with the Terminal application. seq means "print a sequence from x to y". That will save me some time scripting something really simple. Now how soon until I forget this? Quote Mac Pro (Late 2013) Mac OS 12.7.6 Affinity Designer 2.5.5 | Affinity Photo 2.5.5 | Affinity Publisher 2.5.5 | Beta versions as they appear. I have never mastered color management, period, so I cannot help with that. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.