Qr code in the view label.

Qr code in the view label.

aurel_e
Collaborator Collaborator
1,889 Views
18 Replies
Message 1 of 19

Qr code in the view label.

aurel_e
Collaborator
Collaborator

Hi 

I'm trying to set an workflow for opening the files on the shop floor scanning a bar or QR code  printed in the drawing.

I have tried with the Bar code font (showing the Part number), but although 80% of our Part numbers has got 13 characters, sometime people prefer to add a description in the name, then the Barcode result too long and it fail scanning. 

There are some free QR code add-ins available, but since many times we make drawings with more parts in the same sheet, they don't always work for us. Has anyone any idea how to place the QR code in the view label?

 

Thanks.

0 Likes
Accepted solutions (1)
1,890 Views
18 Replies
Replies (18)
Message 2 of 19

Michael.Navara
Advisor
Advisor
Accepted solution

Yes, this is possible. For text conversion you can use for example this free addin CadStudio XToolsLT.

It converts the string to QR code string representation. Later on you cen modify the label of drawing view to display this converted iProperty with QR code string representation.

 

Sample result is in attachment

Message 3 of 19

aurel_e
Collaborator
Collaborator

Hi @Michael.Navara 

I was playing with that add-in earlier this morning without success.

I will have a look later again.

One question: it look that the model has to have these 2 custom properties (QRDstProp and QRScrProp). So I guess it has to be included on all ipt and iam templates. But it cannot be applied for older files. Correct?

Or better: is there any way to link QR code to normal properties like model part numbers?

 

Thanks.

0 Likes
Message 4 of 19

Michael.Navara
Advisor
Advisor

Hi @aurel_e 

QRScrProp must be a user defined iProperty and must exists for successful conversion. If this property doesn't exists, conversion is aborted

QRDstProp must be a user defined iProperty and can be created automatically if needed. (Setting: QRCreateDstProperty = True)

 

If you want to use this tool for existing documents, you need to create QRScrProp in every document. This property can contain an expression, which uses value from another iProperty.

 

Dim doc As Document = ThisDoc.Document
Dim userDefinedProperties As PropertySet = doc.PropertySets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")
Dim QRSrcProp = "QRSrcProp"
Try
	Dim existingProperty = userDefinedProperties(QRSrcProp)
Catch
	userDefinedProperties.Add("=<Part Number>", QRSrcProp)
End Try

 This rule should be external rule and can be triggered by standard iLogic before save trigger (or custom triggers in XTools full version)

In some cases you need to save the document twice. It depends on order of OnSaveHandlers. If conversion to QR occurs before this rule

 

I hope it helps

Message 5 of 19

aurel_e
Collaborator
Collaborator

Thanks @Michael.Navara 

 

I have a rule to add view labels.

 

oModelPN="<StyleOverride Font='" & Sfont1 & "' FontSize='0.1'>" & oPropSet1(1).Value & "</StyleOverride>"

 

I have modified it to include the QR, but because the QR text setting is stretched 180%, the QR code is not resulting square.

I don't know how to include the stretch setting in StyleOverride, or how to set a custom text style on that code line.

I tried to change the addin QR setting to 1 instead of 1.8 but no change.

 

2022-05-26 08_37_53-Autodesk Inventor Professional 2021.png2022-05-26 08_36_59-Autodesk Inventor Professional 2021.png

0 Likes
Message 6 of 19

Michael.Navara
Advisor
Advisor

The QR Mark settings is used only for command QR Code.

MichaelNavara_0-1653551003028.png

 

You need to change the string width directly in view label definition. 

  1. Open view properties (or similar option in Styles Manager)
  2. Edit View label
  3. Select model property placeholder
  4. Set text width to  180%

MichaelNavara_1-1653551198372.png

 

0 Likes
Message 7 of 19

aurel_e
Collaborator
Collaborator

Yes, I know how to do it manually. 

I hoped I could do it automatically with the ilogic like we change the font size:

 

oModelPN="<StyleOverride Font='" & Sfont1 & "' FontSize='0.1'>" & oPropSet1(1).Value & "</StyleOverride>"

0 Likes
Message 8 of 19

Michael.Navara
Advisor
Advisor

You need to be careful to Locale culture decimal separator. 

This works for CZ (use comma as decimal separator)

<StyleOverride Font='Courier New' FontSize='0,1'><Property Document='model' PropertySet='User Defined Properties' Property='QRDstProp' FormatID='{D5CDD505-2E9C-101B-9397-08002B2CF9AE}' PropertyID='4'>QRDstProp</Property></StyleOverride>
0 Likes
Message 9 of 19

aurel_e
Collaborator
Collaborator

Hi @Michael.Navara 

Does this change the text stretch setting?

0 Likes
Message 10 of 19

Michael.Navara
Advisor
Advisor

Or you can use automatic label using standard iProperty (WebLink in this case)

Data flow is shown below and sample is in attachment

QrAutoLabel.png

 

 

0 Likes
Message 11 of 19

aurel_e
Collaborator
Collaborator
Sorry
I can't open the files.
We are on Inventor 2021
Thanks.
0 Likes
Message 12 of 19

Michael.Navara
Advisor
Advisor
No, You need to set the WidthScale property of DrawingViewLabel object to 1.8
0 Likes
Message 13 of 19

Michael.Navara
Advisor
Advisor

Try it again. I replaced the package with 2021 version

0 Likes
Message 14 of 19

aurel_e
Collaborator
Collaborator
Thanks,
I start to understand what you have done.
Interesting way to set it.
I will have a look again later. What I would like to achieve is a label that include other info as well:
-Part number (text)
-Qty: (authority)
-Material
-Description

Also the possibility to set them with different font size and style (underlined, bold...)
And the choice to show the label only when needed.
All this is already done with my ilogic rule.
Just the QR code to be added. (with the right text stretch to 180%)
0 Likes
Message 15 of 19

Michael.Navara
Advisor
Advisor

You can combine this information to one SketchedSymbol. If you place the symbol somewhere on the sheet, the properties becomes from first model. If you attach the symbol to some component, you can use them like a balloon and show properties of specific component.

Message 16 of 19

aurel_e
Collaborator
Collaborator

Another very interesting approach!

I think I have seen it in one of X-ToolsLT videos.

I will have a look later.

It's what I like in these discussion: I always learn new, unexpected tricks.

I still think though it should be an way to customize the text format (stretch included), or use a different text style in a ilogic code line.

Something like this maybe:

 

https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/changing-text-style-when-adding-text...

 

'Setting Text Style
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
	oStylesMgr = oDrawingDoc.StylesManager
	oTextStyle = oStylesMgr.TextStyles.Item(Style)
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Just I don't know yet how to adapt it for my rule

 

 

0 Likes
Message 17 of 19

jernej_puc
Explorer
Explorer

Hi Michael.Navara

 

I am also looking for the simplest way to insert a QR code into drawings, and this solution seems to be the best one so far. However, I searched for the CadStudio XToolsLT add-in and can no longer find it anywhere. It is no longer available on the Autodesk App Store. Does anyone still have the MSI installation file saved?

 

Or perhaps another similar or even better solution?

 

Thank you very much!

Jernej

0 Likes
Message 18 of 19

vladimir_michl
Advisor
Advisor

See Be.Smart T4I (new name of the XTools, no LT version anymore):

https://help.holixa.com/t4r

 

Vladimir Michl, www.arkance.world  -  www.cadforum.cz

 

0 Likes
Message 19 of 19

jernej_puc
Explorer
Explorer

Dear Mr.  vladimir_michl

 

Today I finally received the trial version of the add-in, and it is working perfectly.

Thank you very much for providing this information!

 

Kind regards,

Jernej