Qr code generator for solidworks drawing
- Ömür Tokman
- Posts: 359
- Joined: Sat Mar 13, 2021 3:49 am
- Location: İstanbul-Türkiye
- x 993
- x 345
- Contact:
Qr code generator for solidworks drawing
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.
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.
- Attachments
-
- QrCodeInsert.swp
- (470 KiB) Downloaded 249 times
You ˹alone˺ we worship and You ˹alone˺ we ask for help.
- Ömür Tokman
- Posts: 359
- Joined: Sat Mar 13, 2021 3:49 am
- Location: İstanbul-Türkiye
- x 993
- x 345
- Contact:
Re: Qr code generator.
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.
- AlexLachance
- Posts: 2179
- Joined: Thu Mar 11, 2021 8:14 am
- Location: Quebec
- x 2356
- x 2011
Re: Qr code generator.
Awesome work Omur! I might give it a try and see if we could replace our bar codes with these.Ö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
- Ömür Tokman
- Posts: 359
- Joined: Sat Mar 13, 2021 3:49 am
- Location: İstanbul-Türkiye
- x 993
- x 345
- Contact:
Re: Qr code generator.
I'm looking forward to your return, my mate.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.
You ˹alone˺ we worship and You ˹alone˺ we ask for help.
-
- Posts: 221
- Joined: Tue Mar 09, 2021 7:25 am
- Location: Netherlands
- x 183
- x 229
Re: Qr code generator for solidworks drawing
Would like to test it, but seems missing the QRGen file.
- Ömür Tokman
- Posts: 359
- Joined: Sat Mar 13, 2021 3:49 am
- Location: İstanbul-Türkiye
- x 993
- x 345
- Contact:
Re: Qr code generator for solidworks drawing
You don't need to add any references.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
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.
https://github.com/wqweto/VbQRCodegen
- Attachments
-
- VbQRCodegen-master.zip
- (17.57 KiB) Downloaded 193 times
You ˹alone˺ we worship and You ˹alone˺ we ask for help.
-
- Posts: 221
- Joined: Tue Mar 09, 2021 7:25 am
- Location: Netherlands
- x 183
- x 229
Re: Qr code generator for solidworks drawing
(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.
After clearing the select box of the missing reference, runs great. Good job.
- Ömür Tokman
- Posts: 359
- Joined: Sat Mar 13, 2021 3:49 am
- Location: İstanbul-Türkiye
- x 993
- x 345
- Contact:
Re: Qr code generator for solidworks drawing
Sorry, I didn't quite understand, is it working smoothly now?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
You ˹alone˺ we worship and You ˹alone˺ we ask for help.
-
- Posts: 221
- Joined: Tue Mar 09, 2021 7:25 am
- Location: Netherlands
- x 183
- x 229
Re: Qr code generator for solidworks drawing
Yes, runs smoothly now.Ömür Tokman wrote: ↑Tue Oct 03, 2023 6:37 am Sorry, I didn't quite understand, is it working smoothly now?
- Ömür Tokman
- Posts: 359
- Joined: Sat Mar 13, 2021 3:49 am
- Location: İstanbul-Türkiye
- x 993
- x 345
- Contact:
Re: Qr code generator for solidworks drawing
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.
-
- Posts: 221
- Joined: Tue Mar 09, 2021 7:25 am
- Location: Netherlands
- x 183
- x 229
Re: Qr code generator for solidworks drawing
Thank you for creating this tool.Ö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.
Might flood the SWYM'p with this code.
Re: Qr code generator for solidworks drawing
A very well done job. Thanks
- AlexLachance
- Posts: 2179
- Joined: Thu Mar 11, 2021 8:14 am
- Location: Quebec
- x 2356
- x 2011
Re: Qr code generator for solidworks drawing
I get this error when I run it:
-
- Posts: 221
- Joined: Tue Mar 09, 2021 7:25 am
- Location: Netherlands
- x 183
- x 229
Re: Qr code generator for solidworks drawing
Had the same error. You have to de-select the missing reference, see my post above.
- AlexLachance
- Posts: 2179
- Joined: Thu Mar 11, 2021 8:14 am
- Location: Quebec
- x 2356
- x 2011
Re: Qr code generator for solidworks drawing
Thanks Frank, didn't think it was the same error.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
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 256 times
- Ömür Tokman
- Posts: 359
- Joined: Sat Mar 13, 2021 3:49 am
- Location: İstanbul-Türkiye
- x 993
- x 345
- Contact:
Re: Qr code generator for solidworks drawing
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
Thanks Alex
You ˹alone˺ we worship and You ˹alone˺ we ask for help.
-
- Posts: 6
- Joined: Mon Apr 15, 2024 2:03 am
- x 4
- x 2
Re: Qr code generator for solidworks drawing
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?
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?
- DanPihlaja
- Posts: 842
- Joined: Thu Mar 11, 2021 9:33 am
- Location: Traverse City, MI
- x 807
- x 978
Re: Qr code generator for solidworks drawing
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: 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
Solidworks 2022 SP4
2 Corinthians 13:14
Re: Qr code generator for solidworks drawing
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
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
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
- AlexLachance
- Posts: 2179
- Joined: Thu Mar 11, 2021 8:14 am
- Location: Quebec
- x 2356
- x 2011
Re: Qr code generator for solidworks drawing
Hey Dan,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
Here's how to solve the issue:
Edit the macro and go in Tools>References
Uncheck the missing references and check the ones refering to 2022
- DanPihlaja
- Posts: 842
- Joined: Thu Mar 11, 2021 9:33 am
- Location: Traverse City, MI
- x 807
- x 978
Re: Qr code generator for solidworks drawing
Thank you. I couldn't figure out how people got to the references window.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
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
Solidworks 2022 SP4
2 Corinthians 13:14
-
- Posts: 2
- Joined: Thu Aug 08, 2024 7:54 pm
- x 1
Re: Qr code generator for solidworks drawing
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!
Re: Qr code generator for solidworks drawing
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
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