How to update style of a drawing view?

jesserop
Advocate
Advocate

How to update style of a drawing view?

jesserop
Advocate
Advocate

Hi all,

 

Is it possible to update the style of a drawing view? 
I have used an older " view preference / display" in 7 views, when I change the style within the drawing, it does not automatically change the style of the already placed drawings.  

See picture below, if i change the <view> (<scale>) to some other iproperty, it won't change the text above the popup screen. It will only work for views placed after the change in style. 

0 Likes
Reply
1,424 Views
10 Replies
Replies (10)

A.Acheson
Mentor
Mentor

Have you tried the update style update  command to fetch the latest style from style library? If that isn't working it was purposely disabled for these manual edits. A method would be to clear the label using ilogic and reset the label either with the original contents less the change or update from the style. Of course if you only have a few views the time spent may not be justified but if you have lots of drawing yes it makes sense.

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes

jesserop
Advocate
Advocate

Yes I’ve tried the update style command, but it doesn’t work. The only thing that works is deleting the view and place a new base view.

 

do you happen to know where I can find a macro to do this? It’s quite a big file full of cutting contours so it would make sense to do it like that, as you say

0 Likes

A.Acheson
Mentor
Mentor

Can you supply an image of what is currently in the view label or what you want to have in the view label? There is a few ways to do this. either add the label information as attributes meaning they will update automatically( similar to the image below or to overrirde the label and just place in text. Knowing what is going in there first will help narrow down a rule that will work for you.  Are you able to use VBA or iLogic? iLogic will be the easier to manage. 

 

AAcheson_0-1642095505557.png

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes

jtylerbc
Mentor
Mentor

@jesserop wrote:

Hi all,

 

Is it possible to update the style of a drawing view? 
I have used an older " view preference / display" in 7 views, when I change the style within the drawing, it does not automatically change the style of the already placed drawings.  

See picture below, if i change the <view> (<scale>) to some other iproperty, it won't change the text above the popup screen. It will only work for views placed after the change in style. 


 

No, I don't think this isn't possible.  Changes to the view label settings in the Standard only affect views created after the change - it does not update preexisting ones. 

 

At my company, we actually have a process that uses this intentionally for a particular type of drawing.  We create certain views, then change the active standard to get different view labels for the remaining views.  In your case, it's a limitation instead of an advantage.  

0 Likes

jesserop
Advocate
Advocate

Hi,

 

This is the data I'm trying to retrieve from the Iproperty of a certain part. 
I'm able to slightly modify or combine macro's in VBA but not even close to setting up a macro myself.

0 Likes

A.Acheson
Mentor
Mentor

Here is a post that achieves the linked iproperties in the view label. It will work on the first view of the drawing. If you want to work on all views we can change that later. 

The code is written to work in ilogic but can be adapted for vba with a few tweaks. 

 

https://forums.autodesk.com/t5/inventor-forum/how-to-batch-edit-view-labels-in-existing-drawing/td-p...

 

Unfortunately the prompted text strings that make up each iproperty are a mouthful to figure out.  Don't worry if your iproperty is missing  as we can retrieve that see post below but this is where it gets interesting. 

 

https://forums.autodesk.com/t5/inventor-ilogic-api-vba-forum/custom-user-properties-in-view-label-of...

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes

jesserop
Advocate
Advocate

Hi,

 

I've tried multiple codes but clearly i'm doing something wrong. 
I've made a button connecting to a macro in my toolbar, as seen in the screenshot. 
Then i select a view, but nothing happens. 
The macro doesn't even start, it seems to me. 

 

Test.PNG

0 Likes

A.Acheson
Mentor
Mentor

VBA and ilogic environment are different. 

Firstly you need to change the code like this.

VBA uses  sub routine to fire each block of code. So firstly give a name of sub routine in your module.  

 

Sub ChangeDrawingViewLabel

'PASTE CODE IN HERE

End Sub

 

 

Ilogic:

To use in ilogic follow these steps here. It will be a simple copy and paste then run in to the external rule created. 

https://autodeskmfg.typepad.com/blog/2012/01/working-with-external-ilogic-rules.html

 

 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes

johnsonshiue
Community Manager
Community Manager

Hi! Please take a look at this sample tool shipped with Inventor SDK.

 

https://knowledge.autodesk.com/support/inventor/troubleshooting/caas/sfdcarticles/sfdcarticles/How-t...

 

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes

theo.bot
Collaborator
Collaborator

Replace your object default style, will update the edges and applied layers in your views. As long as objects are not manualy set to a style or layer, objects will follow the new object defaults.

theobot_0-1644304435833.pngtheobot_1-1644304443172.png

As you can see most of the layers and styles are updated.