How to insert a block from a drawing file into a current drawing using autolisp - lisp

What I would like to do is insert specific blocks from a master file depending on user input. These blocks would then be moved around and combined to create a new block. Any help is appreciated.
I have searched online and have found a few examples of what I'm looking for but I can't seem to get anything working properly. My big question would be how do I tell it where the file is located.

Related

ESGF `wget` scripts incorrectly generating; linking to a random unrelated file

About half the time when I click on WGET script following a CMIP6 data search on the ESGF (LLNL node), I get a wget script that only points to one, unrelated file. It's always the same one, too. Here's the relevant line that shows up in each wget file:
download_files="$(cat <<EOF--dataset.file.url.chksum_type.chksum
'famipc5_ne120_v0.3_00001_01_198001_198401_climo.nc' 'http://esgf.anl.gov/thredds/fileServer/esg_dataroot/ACME/climo/amip/v0_3/atm/mon/native/ne120/ens1/famipc5_ne120_v0.3_00001_01_198001_198401_climo.nc' 'SHA256' 'e5040c5df9d080437418943f02a41e84712dbe1c4a69982447712d7c7334241d'
EOF--dataset.file.url.chksum_type.chksum
)"
This happens with a wide variety of datasets. Here's one file where that happens, for example:
CMIP6.CMIP.CCCma.CanESM5.amip.r1i1p1f1.day.pr.gn
I've been searching for a reason, so far without success. A workaround is to hit the "download HTML" button 1000 times for each individual needed file instead (or set up a Globus endpoint for the files where that's possible), but it's very inconvenient and doesn't provide the functionality of a bash script.
Does anyone know what may be causing this? Is there some sort of limit to how many wget scripts an ESGF user can generate per day and these are downloaded as placeholders afterwards instead?
Grateful for any insight!
PS: I apologize for the cdo tag; I know this isn't a cdo problem, but it's hard to find relevant tags for this, and I figured that community may know what's up.
Turns out this is a browser issue. Repeating the search with chrome fixed it.
(Also that stack overflow may have not been the right venue to post this question; but I want this to be searchable somewhere at least)

How to use Powershell to find pdfs in directories that are image based (Windows Environment)?

I am an absolute newbie as far as Powershell goes. I found a script here - https://www.litigationsupporttipofthenight.com/single-post/2020/04/19/powershell-script-to-count-words-lines-and-characters-in-multiple-pdfs - that I thought was exactly what I was looking for but when I run it, it seems that it sees my image based pdfs as just text files and says there are thousands of words/characters in them. I have a feeling that I am missing something.....I see various forum postings on the web regarding itextsharp and searching words in pdfs (no idea if this is it or not)?
Hoping someone can point me in the right direction (a specific example of this on the web somewhere) would be very much appreciated.
Gully

Powershell import encoded module

I am writing a script with a lot of modules but I don't really want the user to see my source code so I figured to encode everything in base64 since the user won't be able to decode it even if it is that basic.
I tried to somehow add an encoded module but no luck.
So my question is -
Is it possible to import a base64 encoded module to the main script file?
If you have any better solutions to hide source code please share, I would be more than happy to try them out.
P.S. I tried to find some info on making a .dll files but found out I would have to rewrite the script in C#. (if I didn't missed anything)
Also I tried to put all modules into one encoded file, but then the file gets too big and Powershell is not able to process it anymore.
You've got two options, which can be combined if you would like to be extremely sure that no one will be able to access your code, making your code into an exe was already mentioned, there are several projects to do this but This one is nice as it is wholly contained within PS. The other, imo better, method is to use an obfuscator, which will take your code and replace variable names with nonsense strings and make other changes to make your code very difficult to read, it's still possible to work out your code but generally not worth the effort, you can find a working one Here. But I do have to add that obfuscating your code really goes against the powershell ethos and I recommend against doing it unless you have some sort of requirement too being passed down from management. And please note that this NOT an acceptable method of obscuring code that includes passwords, api keys, or any other information that needs to be secured as all of those are quite easy to extract from code that has been obfuscated this way.
You could change your ps1 to an exe file by using
https://ps2exe.codeplex.com/
You'd still be able to get at the code if you tried, but it would prevent a casual look.
Why do you want to hide the modules?

Attach google spreadsheet as pdf to email

I would like to create a PDF of a specific sheet (not necessarily the active one) and send it as an email attachment. I've borrowed and tried several code snippets, but none work correctly. I've searched and analyzed all the forums I can find, but I can't figure out the issue. I'm a novice programmer, so I like it simple. This snippet is intuitive to me, but it gives the following error: "We're sorry, no servers are currently available. Please wait a bit and try again." Debugger says that both pdf and attach are undefined.
var pdf = SpreadsheetApp.getActive().getAs('application/pdf').getBytes();
var attach = {fileName:'test.pdf',content:pdf, mimeType:'application/pdf'};
MailApp.sendEmail(recipients, subject, body, {attachments:[attach]});
Three things:
can you help me get the pdf/attachment function working properly?
can you help me modify it for a specific sheet (say, Sheet1)?
is it possible to make a pdf out a range on a sheet rather than the whole sheet?
Thanks!
You're trying to apply methods of one Class to another that does not implement it. (e.g. getAs() isn't a Spreadsheet method.) When you're writing your script, pay attention to the autocomplete feature, which would have helped to avoid this error. See this previous answer for more details about that.
Answers:
See Google Apps Script to Email Active Spreadsheet, which demonstrates how to generate a PDF from a sheet.
To isolate a single sheet, see ajb1970's answer to the same question. The idea here is to copy the sheet you're interested in into a new, temporary, spreadsheet - and then make your PDF from that.
To do this with a range, repeat step 2, but with the range you're interested in.
Use getBlob not getBytes. Also you cant specify a specific sheet. Instead copy that sheet into a new spreadsheet, convert that one to pdf and later delete it.

modify a template PDF using iTextSharp server side

So I'm brand spanking new to iTextSharp and I know I have quite a bit of reading ahead of me but in an attempt to shave a bunch of time off a relatively trivial task I thought I reach out the stack brain-trust.
I have a very simple goal: Starting with a template pdf, I need to create new pdf with a few of the characters changed. We're talking single characters on each page. I don't need a detailed answer complete with code (although that'd be awesome) so much as a general list of tools and api's I'm going to need.
The data I need will already be in a db which I could output to xml files if need be.
So far it looks like my template will need the "editable" characters tagged somehow (not sure how to do that yet) and using PDFStamper I can modify the copy. Is that the right path or is there a better way?
Thanks for any insight.