LayerState Example

Using Programming Languages other than VBA

Sub Example_LayerState()
	' This example demonstrates the
	' CategoryName, LayoutId, LayerState,
	' and HasVpAssociation properties of the View object

	Dim oLSM As AcadLayerStateManager

	' Access the LayerStateManager object
	Set oLSM = ThisDrawing.Application. _
	 GetInterfaceObject("AutoCAD.AcadLayerStateManager.16")

	' Associate the current drawing database with LayerStateManager
	oLSM.SetDatabase ThisDrawing.Database

	oLSM.Save "ColorLinetype", acLsColor + acLsLineType

	' Create a view named "New_View" in current drawing
	Dim viewObj As IAcadView2
   
	' Add the view to the views collection
	Set viewObj = ThisDrawing.Views.Add("New_View")
	MsgBox viewObj.Name & " has been added." & vbCrLf & _
		 "Height: " & viewObj.Height & vbCrLf & _
		 "Width: " & viewObj.Width, , "Example"

	viewObj.CategoryName = "My View Category"
	viewObj.LayerState = "My Layer State"

	viewObj.LayoutId = ThisDrawing.Layouts(1).ObjectID
	
	MsgBox viewObj.CategoryName & " is the Category name." & vbCrLf & _
			viewObj.LayoutId & " is the Layout ID." & vbCrLf & _
			viewObj.LayerState & " is the Layer state."
   
	If viewObj.HasVpAssociation = True Then
		MsgBox "The view is associated with a paper space viewport."
	Else
		MsgBox "The view is not associated with a paper space viewport."

   End If
End Sub

 

   Comments? 
500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@entercad.forsenergy.ru to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.