Error during access Camera into DrawingView

Error during access Camera into DrawingView

Anonymous
Not applicable
348 Views
4 Replies
Message 1 of 5

Error during access Camera into DrawingView

Anonymous
Not applicable
Hi!
I try to get camera object for selected drawing view. I use vba macro for this (below) and in string "set oCam = oView.Camera" i get Run-time error 445 Object doesnot support this action. How to solve this situation?

Dim oSelectSet As SelectSet
Set oSelectSet = ThisApplication.ActiveDocument.SelectSet

' Check to make sure a single item was selected.
If oSelectSet.Count = 1 Then
' Check to make sure a face was selected.
If TypeOf oSelectSet.Item(1) Is DrawingView Then
' Set a reference to the selected face.
Dim oView As DrawingView
Set oView = oSelectSet.Item(1)

MsgBox oView.Name

Dim oCam As Camera
set oCam = oView.Camera
End If
Else
MsgBox "You must select a single drawing view."
Exit Sub
End If
0 Likes
349 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
The code seems fine, what type of view do you have selected? Does it fail
with any other view types?

Neil



wrote in message news:5730778@discussion.autodesk.com...
Hi!
I try to get camera object for selected drawing view. I use vba macro for
this (below) and in string "set oCam = oView.Camera" i get Run-time error
445 Object doesnot support this action. How to solve this situation?

Dim oSelectSet As SelectSet
Set oSelectSet = ThisApplication.ActiveDocument.SelectSet

' Check to make sure a single item was selected.
If oSelectSet.Count = 1 Then
' Check to make sure a face was selected.
If TypeOf oSelectSet.Item(1) Is DrawingView Then
' Set a reference to the selected face.
Dim oView As DrawingView
Set oView = oSelectSet.Item(1)

MsgBox oView.Name

Dim oCam As Camera
set oCam = oView.Camera
End If
Else
MsgBox "You must select a single drawing view."
Exit Sub
End If
0 Likes
Message 3 of 5

Anonymous
Not applicable
Very interesting, but i get same error on all views. I tested macro in AIP 11 SP3. I don't know what to do?
0 Likes
Message 4 of 5

Anonymous
Not applicable
That is indeed the problem, it is supported in 2008 API, not in R11. Sorry.

Neil

wrote in message news:5730762@discussion.autodesk.com...
Very interesting, but i get same error on all views. I tested macro in AIP
11 SP3. I don't know what to do?
0 Likes
Message 5 of 5

Anonymous
Not applicable
Thanks, Neil.
0 Likes