Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
If the base view is an isometric view in idw Titleblock scale value should b NTS
-karthik
Solved! Go to Solution.
Hi,
If the base view is an isometric view in idw Titleblock scale value should b NTS
-karthik
Solved! Go to Solution.
Hi,
Sorry, previously posted on my other account!
This does a check for the first drawingview placed on a sheet (base view)
Because i don't know how you fill the titleblock, i can't help you with that.
If needed provide more info please
Sub DrawingViewOrientation() Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet Set oSheet = oDoc.ActiveSheet Dim oDrawView As DrawingView Set oDrawView = oSheet.DrawingViews(1) If oDrawView.Camera.ViewOrientationType = kArbitraryViewOrientation Then MsgBox "view is iso" Else MsgBox "view is bottom/top/..." End If End Sub
Hi,
Title block scale value comes under Prompted entry field edit. Plz refer attachment.
-karthikeyan M
Hi,
Then this is the code that you need...
Sub DrawingViewOrientationInTitleBlock() Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet Set oSheet = oDoc.ActiveSheet Dim oDrawView As DrawingView Set oDrawView = oSheet.DrawingViews(1) If oDrawView.Camera.ViewOrientationType = kArbitraryViewOrientation Then strscale = "NTSA" Else strscale = oDrawView.ScaleString End If Dim oTitleBlock As TitleBlock Set oTitleBlock = oSheet.TitleBlock Dim oTextbox As TextBox For Each oTextbox In oTitleBlock.Definition.Sketch.TextBoxes If oTextbox.Text = "Scale" Then 'This is the name you see in the promted text dialog box Call oTitleBlock.SetPromptResultText(oTextbox, strscale) Exit For End If Next oTextbox End Sub
Hi,
This code is not working. If i run this code Scale value is coming as per Base scale view. Not NTS. If the base view is an isometric view then scale value should be NTS.
-karthikeyanM
Hi,
Indeed, i must have overlooked something, it looks now at the upvector, when 1 out of 3 vectors is 1, it means that you are looking perpendicular to the part/assy
Sub DrawingViewOrientationInTitleBlock() Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet Set oSheet = oDoc.ActiveSheet Dim oDrawView As DrawingView Set oDrawView = oSheet.DrawingViews(1) If oDrawView.Camera.UpVector.X = 1 Or oDrawView.Camera.UpVector.Y = 1 Or oDrawView.Camera.UpVector.Z = 1 Then strscale = oDrawView.ScaleString Else strscale = "NTS" End If Dim oTitleBlock As TitleBlock Set oTitleBlock = oSheet.TitleBlock Dim oTextbox As TextBox For Each oTextbox In oTitleBlock.Definition.Sketch.TextBoxes If oTextbox.Text = "Scale" Then 'This is the name you see in the promted text dialog box Call oTitleBlock.SetPromptResultText(oTextbox, strscale) Exit For End If Next oTextbox End Sub
Just wondering if this could be tweeked to override the view label to show NTS for all ISO views? Thanks