Custom iProperty in idw STYLES

Custom iProperty in idw STYLES

cadman777
Advisor Advisor
1,263 Views
9 Replies
Message 1 of 10

Custom iProperty in idw STYLES

cadman777
Advisor
Advisor

Hi All,

This is a long-standing question I've had since 2010.

I'd be grateful for an answer.

Can a macro be made to input a Custom iProperty here in my DRAWING TEMPLATE?:

Manage>Styles and Standards>Standard>(click on the name of your standard)>View Preferences>Display>Edit View Label (the Pencil icon)>Type (dropdown) - no Custom iProperty is available there. I want to insert the Custom iProperty into the Text Editor as a line-item. See here:

Custom iProperties in View Label STYLE-01.JPG

Much obliged!

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
1,264 Views
9 Replies
Replies (9)
Message 2 of 10

pball
Mentor
Mentor

If you're referring to custom iProperties from models I've only figured out one way to do that. If you insert a model into your template file and add the custom iProperties from that model you want, the model can then be deleted and the template saved. When you create a new drawing and insert a model that property will relink with the new model.

 

If you edit the template that custom iProperty value won't be editable unless you insert a model again.

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style

Userscript to edit forum links to jump to first unread post
Jump To First Post Userscript
0 Likes
Message 3 of 10

cadman777
Advisor
Advisor

Hi Pball,

Thanx for your reply.

I did do that many years ago, and didn't get any results.

So I must be missing something in the process.

Would you please show me where you "add the custom iProperties from that model"?
I don't know what you mean by that.

Thanx!

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 4 of 10

rhasell
Advisor
Advisor

Hi

 

I don't think you can do that in the styles editor.

 

Play around with the following code, I extracted a small section from my code, it should help you on your way.

 

My label format is different to yours, but I left some of the formatting etc for you to get an idea of how it works.

But the main thing is your custom iProperty entry of "SIZE" that should work for you.

 

 

Sub Main oView
Dim oSSet As SelectSet = ThisDoc.Document.SelectSet
If oSSet.Count = 0 Then
oView = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select a View") 'Added Rev2
oSSet.Select(oView)
End If
oLabel()
End Sub

Sub oLabel
Dim oSSet As SelectSet = ThisDoc.Document.SelectSet
Dim oView As DrawingView= TryCast(oSSet.Item(1), DrawingView)
oModel = ThisDoc.ModelDocument
If oView IsNot Nothing Then
oView.ShowLabel = True

o_iPropID_SIZE = oModel.PropertySets.Item("User Defined Properties").Item("SIZE").PropId

	 oStringSIZE = "<StyleOverride Underline='True' FontSize='0.5' Bold='True'><Property Document='model' PropertySet='User Defined Properties' Property='customPropertyName' FormatID='{D5CDD505-2E9C-101B-9397-08002B2CF9AE}' PropertyID='" _
	 & o_iPropID_SIZE & "'>customPropertyName </Property></StyleOverride>"
 
	oStringTXT = "<StyleOverride Underline='True' FontSize='0.5' Bold='False'> OFF - AS SHOWN - MARK AS - </StyleOverride>"
	oStringScale = "<Br/><StyleOverride FontSize='0.25'>SCALE <DrawingViewScale/></StyleOverride>"

'add to the view label
oView.Label.FormattedText =  oStringTXT & oStringSIZE & oStringScale
Else
	MessageBox.Show("The selected object is not a drawing view", "iLogic")
End If
End Sub
Reg
2026.3
0 Likes
Message 5 of 10

pball
Mentor
Mentor

@cadman777 

When a model view is added to a drawing the Custom Properties - Model option appears. Then it's possible to add those to your text. The model view can then be removed and the drawing saved as a template file. Next time a model view is added those properties will show that models info.

 

Capture.PNG

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style

Userscript to edit forum links to jump to first unread post
Jump To First Post Userscript
0 Likes
Message 6 of 10

cadman777
Advisor
Advisor

Pball,

Thanx for your input.

I really don't understand what you're saying, b/c that's not how it works with my Inventor software.

What Inventor version do you have?
I'm using 2010.

I don't know of any way to make the Custom Model iProperties get into the view label AUTOMATICALLY unless they are setup in your Styles and Standards. Inventor 2010 doesn't allow Custom Model iProperties to be inserted into the Styles and Standards view labels. And if it's not in the Style, then it ain't gonna be in the label when you place a Base View.

So how in the world does your Inventor version allow this?

You got me curious!

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 7 of 10

pball
Mentor
Mentor

I guess the way I'm doing it isn't available in 2010. I've been using this method since at least 2014 so I'm not sure when things might have changed. Sorry I can't be of any help since I don't have 2010.

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style

Userscript to edit forum links to jump to first unread post
Jump To First Post Userscript
0 Likes
Message 8 of 10

rhasell
Advisor
Advisor

Hi Chris

 

It does not work in the Styles and Standards. I tested it in 2020, the option is not available.

It does however work when you edit an exiting label. (Admittedly, I do not know about 2010)

 

Try the code, but I am not sure if it works in 2010.

 

 

Reg
2026.3
0 Likes
Message 9 of 10

cadman777
Advisor
Advisor

Thanx Reg,

Let me see if I can hack my way through your code to do something with it.

I got help in another thread on a similar issue from another kind gentleman in this forum.

Hopefully, between the two of you and all the other bits and pieces I've gathered in here, I can cobble together something to suit my needs.

Cheers ...

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 10 of 10

cadman777
Advisor
Advisor

Thanx for the confirmation.

This is something Autodesk SHOULD HAVE added to Inventor many moons ago.

Same with using iProperties in Parts List titles.

It's just a simple matter of DATA MANAGEMENT consistent throughout the software.

Cheers ...

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator