Create a View with CategoryName

Create a View with CategoryName

Anonymous
Not applicable
321 Views
0 Replies
Message 1 of 1

Create a View with CategoryName

Anonymous
Not applicable

Hello all,

 

Im currenty working on a method of inserting multiple drawings (from 3rd party) into 1 model drawing and creating views for use with the SSM. It is all working well except I am having issues with assigning a CategoryName. The information is as a String, and is part of the ViewTableRecord. When I try to assign it a value "Longsection" for example I get an error message "eNoDatabase" error.

 

my Code snippet:

[code]

For Each myVP In myViewPorts
'' Check to see if the named view 'View1' exists
If (acViewTbl.Has(myVP.Name) = False) Then
'' Open the View Table for write
acViewTbl.UpgradeOpen()

'' Create a new View table record and name the view "View1"
Dim acViewTblRec As ViewTableRecord = New ViewTableRecord()
acViewTblRec.Name = myVP.Name
acViewTblRec.CenterPoint = New Point2d((myVP.Min.X + myVP.Max.X) / 2, (myVP.Min.Y + myVP.Max.Y) / 2)
acViewTblRec.Width = myVP.Max.X - myVP.Min.X
acViewTblRec.Height = myVP.Max.Y - myVP.Min.Y
acViewTblRec.ViewTwist = myVP.Rotation
acViewTblRec.CategoryName = myVP.Catagory
acViewTblRec.AnnotationScale = myVPScale


'' Add the new View table record to the View table and the transaction
acViewTbl.Add(acViewTblRec)
acTrans.AddNewlyCreatedDBObject(acViewTblRec, True)

acDoc.Editor.WriteMessage(vbLf & "Created View: " & myVP.Name)
End If
Next

[/code]

 

 

Any help would be greatly appeciated.

 

Thanks

 

Adam.

 

 

0 Likes
322 Views
0 Replies
Replies (0)