iLogic - Drawing View name or Scalestring - Help

iLogic - Drawing View name or Scalestring - Help

Anonymous
Not applicable
1,716 Views
3 Replies
Message 1 of 4

iLogic - Drawing View name or Scalestring - Help

Anonymous
Not applicable

Ok, Not that good in VB.

But I can see in the API help that there is a call for getting the Scale from Base.

I want to capture the scale from the Base view and put it in my Titleblock and be able to change it from a dialog box.

If I can get the Scale string in ilogic I can do a lot with it.

I can see that there is a stock Scalestring if you KNOW the view name.

I can assume the View name or ask for it, but if it is in the code I want to rule eliminate typos, errors,etc...

 

I either need code for getting the scalestring directly or how to find the base view name.

 

Can someone please make a suggestion?

 

Thank you in advance.

0 Likes
1,717 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

Finally found the syntax.

But not from any help here.

the documentation needs to be improved.

So for those that need to find it like me

Here's how to find the first Drawing View Name:

 

Dim odoc As DrawingDocument
odoc = ThisApplication.ActiveDocument
Dim oPtDoc As String
oPtDoc = odoc.ActiveSheet.DrawingViews(1).Name 

Use it in Good Health

Message 3 of 4

MjDeck
Autodesk
Autodesk

Usually the base view would be the first view on the sheet, so using DrawingViews(1) would work.

 

 Here's a way to find the first base view on the active sheet:

 

Dim baseView As DrawingView = Nothing
For Each view As DrawingView In ActiveSheet.Sheet.DrawingViews
  If (view.ParentView Is Nothing) Then
	baseView = view
	Exit For
  End If
Next

If (baseView Is Nothing) Then Return
' ... do something with baseView ...


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 4 of 4

Anonymous
Not applicable

Mike,

Thank you, this is better code.

However, it will only finds teh first view that does not have a parent.

 

If someone creates a base view and an iso view, then deletes the base view, then creates a new base view.   The first view without a base view it will come to is the iso view.

 

So closer.

 

Thank you.

0 Likes