Qr code generator for solidworks drawing

Library for macros
User avatar
Ömür Tokman
Posts: 361
Joined: Sat Mar 13, 2021 3:49 am
Answers: 1
Location: İstanbul-Türkiye
x 995
x 347
Contact:

Qr code generator for solidworks drawing

Unread post by Ömür Tokman »

Hello everybody,
This is the macro I've been wanting to make for a while.
First of all, I would like to remind you! I am not a programmer, the macro I made is to meet my needs. And it works well enough to meet my needs for now.
It would be great if someone who understands the software could fill in the shortcomings of the macro.
It adds the text written in the textbox to the page as a QR code.
The reason I went with the macro is that it is a single file, does not require installation and I want to write only with VBA. The address where I downloaded the QR code generating module is written on the module page. Does not require internet.
As I said at the beginning, this macro is just to meet my basic needs. "Be sure to test it!" I'm sharing it in case anyone wants to improve it.
2023-10-02_14-04-41.jpg
Attachments
QrCodeInsert.swp
(470 KiB) Downloaded 332 times
You ˹alone˺ we worship and You ˹alone˺ we ask for help.
User avatar
gupta9665
Posts: 416
Joined: Thu Mar 11, 2021 10:20 am
Answers: 25
Location: India
x 435
x 455

Re: Qr code generator.

Unread post by gupta9665 »

Thank you for sharing :)
Deepak Gupta
SOLIDWORKS Consultant/Blogger
User avatar
Ömür Tokman
Posts: 361
Joined: Sat Mar 13, 2021 3:49 am
Answers: 1
Location: İstanbul-Türkiye
x 995
x 347
Contact:

Re: Qr code generator.

Unread post by Ömür Tokman »

gupta9665 wrote: Mon Oct 02, 2023 1:55 pm Thank you for sharing :)
Actually i thank you. This is such a small thing compared to what you have done for us. Mr. Gupta I learned a lot from you.
You ˹alone˺ we worship and You ˹alone˺ we ask for help.
User avatar
AlexLachance
Posts: 2196
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2382
x 2025

Re: Qr code generator.

Unread post by AlexLachance »

Ömür Tokman wrote: Mon Oct 02, 2023 8:12 am Hello everybody,
This is the macro I've been wanting to make for a while.
First of all, I would like to remind you! I am not a programmer, the macro I made is to meet my needs. And it works well enough to meet my needs for now.
It would be great if someone who understands the software could fill in the shortcomings of the macro.
It adds the text written in the textbox to the page as a QR code.
The reason I went with the macro is that it is a single file, does not require installation and I want to write only with VBA. The address where I downloaded the QR code generating module is written on the module page. Does not require internet.
As I said at the beginning, this macro is just to meet my basic needs. "Be sure to test it!" I'm sharing it in case anyone wants to improve it.

2023-10-02_14-04-41.jpg
Awesome work Omur! I might give it a try and see if we could replace our bar codes with these.
User avatar
Ömür Tokman
Posts: 361
Joined: Sat Mar 13, 2021 3:49 am
Answers: 1
Location: İstanbul-Türkiye
x 995
x 347
Contact:

Re: Qr code generator.

Unread post by Ömür Tokman »

AlexLachance wrote: Mon Oct 02, 2023 2:41 pm Awesome work Omur! I might give it a try and see if we could replace our bar codes with these.
I'm looking forward to your return, my mate.
You ˹alone˺ we worship and You ˹alone˺ we ask for help.
Frank_Oostendorp
Posts: 221
Joined: Tue Mar 09, 2021 7:25 am
Answers: 3
Location: Netherlands
x 184
x 229

Re: Qr code generator for solidworks drawing

Unread post by Frank_Oostendorp »

Would like to test it, but seems missing the QRGen file.
image.png
image.png
User avatar
Ömür Tokman
Posts: 361
Joined: Sat Mar 13, 2021 3:49 am
Answers: 1
Location: İstanbul-Türkiye
x 995
x 347
Contact:

Re: Qr code generator for solidworks drawing

Unread post by Ömür Tokman »

Frank_Oostendorp wrote: Tue Oct 03, 2023 4:01 am Would like to test it, but seems missing the QRGen file.
image.png
image.png
You don't need to add any references.
That reference is from a different attempt.
I added a module to create a qr code, but if you need to add it too, I'm adding it here.
image.png
image.png (4.75 KiB) Viewed 6400 times
2023-10-03_12-08-12.png
2023-10-03_12-09-08.png
https://github.com/wqweto/VbQRCodegen
Attachments
VbQRCodegen-master.zip
(17.57 KiB) Downloaded 277 times
You ˹alone˺ we worship and You ˹alone˺ we ask for help.
Frank_Oostendorp
Posts: 221
Joined: Tue Mar 09, 2021 7:25 am
Answers: 3
Location: Netherlands
x 184
x 229

Re: Qr code generator for solidworks drawing

Unread post by Frank_Oostendorp »

(Thanks, sorry but it throws another error. Let's see if Alex can test it.)
After clearing the select box of the missing reference, runs great. Good job.
image.png
User avatar
Ömür Tokman
Posts: 361
Joined: Sat Mar 13, 2021 3:49 am
Answers: 1
Location: İstanbul-Türkiye
x 995
x 347
Contact:

Re: Qr code generator for solidworks drawing

Unread post by Ömür Tokman »

Frank_Oostendorp wrote: Tue Oct 03, 2023 5:52 am (Thanks, sorry but it throws another error. Let's see if Alex can test it.)
After clearing the select box of the missing reference, runs great. Good job.

image.png
Sorry, I didn't quite understand, is it working smoothly now?
You ˹alone˺ we worship and You ˹alone˺ we ask for help.
Frank_Oostendorp
Posts: 221
Joined: Tue Mar 09, 2021 7:25 am
Answers: 3
Location: Netherlands
x 184
x 229

Re: Qr code generator for solidworks drawing

Unread post by Frank_Oostendorp »

Ömür Tokman wrote: Tue Oct 03, 2023 6:37 am Sorry, I didn't quite understand, is it working smoothly now?
Yes, runs smoothly now.
image.png
User avatar
Ömür Tokman
Posts: 361
Joined: Sat Mar 13, 2021 3:49 am
Answers: 1
Location: İstanbul-Türkiye
x 995
x 347
Contact:

Re: Qr code generator for solidworks drawing

Unread post by Ömür Tokman »

Frank_Oostendorp wrote: Tue Oct 03, 2023 7:08 am Yes, runs smoothly now.
image.png
Thank you very much for the feedback. It's nice to be useful to someone, the qr code link is nice.
You ˹alone˺ we worship and You ˹alone˺ we ask for help.
Frank_Oostendorp
Posts: 221
Joined: Tue Mar 09, 2021 7:25 am
Answers: 3
Location: Netherlands
x 184
x 229

Re: Qr code generator for solidworks drawing

Unread post by Frank_Oostendorp »

Ömür Tokman wrote: Tue Oct 03, 2023 7:56 am Thank you very much for the feedback. It's nice to be useful to someone, the qr code link is nice.
Thank you for creating this tool.
Might flood the SWYM'p with this code. :D
mme
Posts: 9
Joined: Fri Apr 09, 2021 2:11 am
Answers: 0
x 10

Re: Qr code generator for solidworks drawing

Unread post by mme »

A very well done job. Thanks
User avatar
AlexLachance
Posts: 2196
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2382
x 2025

Re: Qr code generator for solidworks drawing

Unread post by AlexLachance »

I get this error when I run it:
image.png
image.png
Frank_Oostendorp
Posts: 221
Joined: Tue Mar 09, 2021 7:25 am
Answers: 3
Location: Netherlands
x 184
x 229

Re: Qr code generator for solidworks drawing

Unread post by Frank_Oostendorp »

AlexLachance wrote: Wed Oct 04, 2023 9:39 am I get this error when I run it:
image.png

image.png
Had the same error. You have to de-select the missing reference, see my post above.
image.png
image.png (65.83 KiB) Viewed 6211 times
User avatar
AlexLachance
Posts: 2196
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2382
x 2025

Re: Qr code generator for solidworks drawing

Unread post by AlexLachance »

Frank_Oostendorp wrote: Wed Oct 04, 2023 10:05 am Had the same error. You have to de-select the missing reference, see my post above.
image.png
Thanks Frank, didn't think it was the same error.

After clearing it, it works like a charm. Here's the macro with the missing reference removed for those who don't know how to remove it.
Attachments
QrCodeInsert.swp
(470 KiB) Downloaded 333 times
User avatar
Ömür Tokman
Posts: 361
Joined: Sat Mar 13, 2021 3:49 am
Answers: 1
Location: İstanbul-Türkiye
x 995
x 347
Contact:

Re: Qr code generator for solidworks drawing

Unread post by Ömür Tokman »

Yes, I added that reference without removing it. Good thing you removed the reference and added it, I forgot to add it again.
Thanks Alex
You ˹alone˺ we worship and You ˹alone˺ we ask for help.
Monstrum Mathias
Posts: 9
Joined: Mon Apr 15, 2024 2:03 am
Answers: 0
x 5
x 3

Re: Qr code generator for solidworks drawing

Unread post by Monstrum Mathias »

Many thanks Ömür. This is a really useful code.
I use it for displaying dropbox-links for pdf and edrawings on the SolidWorks drawings.
When it inserts the picture it varies a great deal in size. Is there an easy way to adjust this size to a fixed value within the code?
What would be truly awesome is if the code was able to get the dropbox path of the pdf with the same name as the drawing and then paste that into the window. Is that at all possible within a macro in SW or is that wanting too much?
User avatar
DanPihlaja
Posts: 852
Joined: Thu Mar 11, 2021 9:33 am
Answers: 25
Location: Traverse City, MI
x 813
x 983

Re: Qr code generator for solidworks drawing

Unread post by DanPihlaja »

AlexLachance wrote: Wed Oct 04, 2023 11:05 am Thanks Frank, didn't think it was the same error.

After clearing it, it works like a charm. Here's the macro with the missing reference removed for those who don't know how to remove it.

I get the following error whenever I run the modified version shared by Alex:
image.png
This happens after I type something in the box and select "generate QR Code"

I am using SW 2022 SP4 on Windows 10
-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
User avatar
SPerman
Posts: 2059
Joined: Wed Mar 17, 2021 4:24 pm
Answers: 14
x 2232
x 1878
Contact:

Re: Qr code generator for solidworks drawing

Unread post by SPerman »

In the VBA editor, go to 'Tools-> References'. There is probably a broken reference that either needs to be unchecked, or more likely pointed to the correct dll.

This link has a more thorough explanation.
https://kb.blackbaud.com/knowledgebase/Article/75344
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
User avatar
AlexLachance
Posts: 2196
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2382
x 2025

Re: Qr code generator for solidworks drawing

Unread post by AlexLachance »

DanPihlaja wrote: Thu Apr 18, 2024 11:22 am I get the following error whenever I run the modified version shared by Alex:
image.png

This happens after I type something in the box and select "generate QR Code"

I am using SW 2022 SP4 on Windows 10
Hey Dan,

Here's how to solve the issue:

Edit the macro and go in Tools>References
image.png
Uncheck the missing references and check the ones refering to 2022
image.png
User avatar
DanPihlaja
Posts: 852
Joined: Thu Mar 11, 2021 9:33 am
Answers: 25
Location: Traverse City, MI
x 813
x 983

Re: Qr code generator for solidworks drawing

Unread post by DanPihlaja »

AlexLachance wrote: Thu Apr 18, 2024 11:29 am Hey Dan,

Here's how to solve the issue:

Edit the macro and go in Tools>References

image.png

Uncheck the missing references and check the ones refering to 2022
image.png
Thank you. I couldn't figure out how people got to the references window.

I looked at the help file and the only thing it said was "show the references window" I was like, "HOW!!?"

lol
-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
hugozanga2024
Posts: 2
Joined: Thu Aug 08, 2024 7:54 pm
Answers: 0
x 1

Re: Qr code generator for solidworks drawing

Unread post by hugozanga2024 »

Thank you for sharing your QR code generator macro! It's impressive that you've crafted a solution tailored to your needs, especially without a programming background. I'll definitely give it a try. Hopefully, others in the community can help enhance it further. Great job!
User avatar
DeDum
Posts: 5
Joined: Sat Feb 26, 2022 9:01 am
Answers: 1
x 3

Re: Qr code generator for solidworks drawing

Unread post by DeDum »

Thanks for sharing the qr generator!

My sketch picture dialog stays open. API says something about "This method does not support drawing documents" for the below code line
Part.SketchManager.InsertSketch2 True

Using this line of code instead seems to exit the sketch picture dialog.
Part.EditSheet 'exit edit sheet format

If you want to insert a couple QR codes without macro closing run it as vbModeless and comment out the unload
UserForm1.Show vbModeless
'Unload Me
Post Reply