discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: [OpenSCAD] Newbie question/problem....

M
MichaelAtOz
Fri, Jan 15, 2016 12:32 AM

macdarren wrote

I was pleased to see the recent updates include provisions for placing
text in models.
I never loved any of the packages I used in the past so I am hopeful the
built in features will get me,
what I am looking for, however so far I haven't had any luck figuring it
out.

I can place text that is no problem.
What I can't seem to do is generate text which is what I think I need to
do.

I make multiple piece models sometimes there are many iterations over a
short time frame.
Often the individual parts change very little, however they are often NOT
interchangeable.
These parts are printed or milled over time and assembled.

What I want to do is generate a serial/revision number (that I don't have
to set manually)
each time I build a final STL, I want that number placed on the individual
parts so that they can be
latter assembled and I can know which parts go together to form a single
unit.

What I do now is set a constant at the top of the file(s) like "A" or "B"
then use text functions
to place that on each of the model components in a area that doesn't
affect them or their assembly.

This does work but not when I forget to update the rev number, I want this
to be automated.  I don't care
if there are lots of unused rev IDs, say from each time I generate a file
but then decide to update it again before I commit them to the printer or
mill.

I have considered trying random number generation but that really doesn't
assure unique IDs

If there were some way to read and write to a file each time the STL is
built I could use that, or if I could
generate a time stamp that I could embed (though that could be too large
to place on my parts)
Maybe some sort of hashing where I could use the current time to pull an
entry from a table but I just need that unique time or number first.

Can I do this?  If not is there maybe a better way that I am just not
thinking about to somehow identify
actual parts as opposed to the file that was used to make them which of
course is time stamped.

Thanks
Darren

Hi Darren,
Welcome to the forum. Your post is still flagged as "This post has NOT been
accepted by the mailing list yet", so nobody gets it unless they look.
You need to subscribe to the  mailing list
http://forum.openscad.org/mailing_list/MailingListOptions.jtp?forum=1  ,
and respond to the registration email.

Re your issue:

If your stuff is complex you could consider  command line use
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment
and use make.
You could use an include<> file, have the version number variable there,
updated each time you build.

It doesn't make sense to have a GUI feature for something like this, but
with Auto-reload-and-preview, if you have some external script (say on a
desktop icon) which increments the include<> file variable, it would auto
preview any open instances. You would need to render/export.

There are others here who do command-line stuff who may have other ideas.


Newly minted Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

View this message in context: http://forum.openscad.org/Newbie-question-problem-tp15687p15688.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

macdarren wrote > I was pleased to see the recent updates include provisions for placing > text in models. > I never loved any of the packages I used in the past so I am hopeful the > built in features will get me, > what I am looking for, however so far I haven't had any luck figuring it > out. > > I can place text that is no problem. > What I can't seem to do is generate text which is what I think I need to > do. > > I make multiple piece models sometimes there are many iterations over a > short time frame. > Often the individual parts change very little, however they are often NOT > interchangeable. > These parts are printed or milled over time and assembled. > > What I want to do is generate a serial/revision number (that I don't have > to set manually) > each time I build a final STL, I want that number placed on the individual > parts so that they can be > latter assembled and I can know which parts go together to form a single > unit. > > What I do now is set a constant at the top of the file(s) like "A" or "B" > then use text functions > to place that on each of the model components in a area that doesn't > affect them or their assembly. > > This does work but not when I forget to update the rev number, I want this > to be automated. I don't care > if there are lots of unused rev IDs, say from each time I generate a file > but then decide to update it again before I commit them to the printer or > mill. > > I have considered trying random number generation but that really doesn't > assure unique IDs > > If there were some way to read and write to a file each time the STL is > built I could use that, or if I could > generate a time stamp that I could embed (though that could be too large > to place on my parts) > Maybe some sort of hashing where I could use the current time to pull an > entry from a table but I just need that unique time or number first. > > Can I do this? If not is there maybe a better way that I am just not > thinking about to somehow identify > actual parts as opposed to the file that was used to make them which of > course is time stamped. > > > Thanks > Darren Hi Darren, Welcome to the forum. Your post is still flagged as "This post has NOT been accepted by the mailing list yet", so nobody gets it unless they look. You need to subscribe to the mailing list <http://forum.openscad.org/mailing_list/MailingListOptions.jtp?forum=1> , and respond to the registration email. Re your issue: If your stuff is complex you could consider command line use <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment> and use make. You could use an include<> file, have the version number variable there, updated each time you build. It doesn't make sense to have a GUI feature for something like this, but with Auto-reload-and-preview, if you have some external script (say on a desktop icon) which increments the include<> file variable, it would auto preview any open instances. You would need to render/export. There are others here who do command-line stuff who may have other ideas. ----- Newly minted Admin - PM me if you need anything, or if I've done something stupid... Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- View this message in context: http://forum.openscad.org/Newbie-question-problem-tp15687p15688.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
macdarren
Fri, Jan 15, 2016 12:48 AM

Thanks for the response...I thought I had gotten the mailing list set, by
sending the subscribe and visiting the web site that was in the reply.  I
resubscribed and this time replied to the email and then got a confirmation
so now I think I am good...not sure if I should repost my message.

At any rate....maybe I don't need a 'GUI' feature as just a simple way to
get the current date/time with a function like 'time()' similar to 'rands()'
I could then use this to generate my serial/rev number.
Not as elegant as something sequential but useable.

I will look into the command line idea...

Darren

--
View this message in context: http://forum.openscad.org/Newbie-question-problem-tp15687p15689.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Thanks for the response...I thought I had gotten the mailing list set, by sending the subscribe and visiting the web site that was in the reply. I resubscribed and this time replied to the email and then got a confirmation so now I think I am good...not sure if I should repost my message. At any rate....maybe I don't need a 'GUI' feature as just a simple way to get the current date/time with a function like 'time()' similar to 'rands()' I could then use this to generate my serial/rev number. Not as elegant as something sequential but useable. I will look into the command line idea... Darren -- View this message in context: http://forum.openscad.org/Newbie-question-problem-tp15687p15689.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Fri, Jan 15, 2016 12:54 AM

https://github.com/openscad/openscad/issues/380


Newly minted Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

View this message in context: http://forum.openscad.org/Newbie-question-problem-tp15687p15690.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

https://github.com/openscad/openscad/issues/380 ----- Newly minted Admin - PM me if you need anything, or if I've done something stupid... Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- View this message in context: http://forum.openscad.org/Newbie-question-problem-tp15687p15690.html Sent from the OpenSCAD mailing list archive at Nabble.com.