.NET

Reply
Distinguished Contributor
Mikko
Posts: 212
Registered: ‎10-03-2003
Message 11 of 15 (53 Views)

Re: Add Linetype to Layer

09-19-2006 10:10 AM in reply to: Littlerubarbwk
I added a loop to SetMyLayers that adds hundreds of layers.
Doesn't seem to have any problem.

Public Sub SetMyLayers()
For i As Integer = 90 To 1 Step -1
visibleId = CheckForLayer("my01" & i.ToString, 7, "Continuous")
hiddenId = CheckForLayer("my02" & i.ToString, 2, "Hidden")
centerId = CheckForLayer("my03" & i.ToString, 6, "Center")
dimensionId = CheckForLayer("my04" & i.ToString, 3, "Continuous")
partId = CheckForLayer("my05" & i.ToString, 5, "Phantom")
part2Id = CheckForLayer("my06" & i.ToString, 1, "Phantom")
movementId = CheckForLayer("my07" & i.ToString, 4, "Phantom2")
interfaceequipId = CheckForLayer("my08" & i.ToString, 30, "Phantom")
interfaceequip2Id = CheckForLayer("my09" & i.ToString, 201, "Phantom")
balloonId = CheckForLayer("BallnStock" & i.ToString, 146, "Continuous")
Next
End Sub
Active Contributor
Littlerubarbwk
Posts: 38
Registered: ‎09-08-2006
Message 12 of 15 (53 Views)

Re: Add Linetype to Layer

09-19-2006 12:59 PM in reply to: Littlerubarbwk
Could it be that I'm pulling the variables from a dataset?
Distinguished Contributor
Mikko
Posts: 212
Registered: ‎10-03-2003
Message 13 of 15 (53 Views)

Re: Add Linetype to Layer

09-20-2006 06:19 AM in reply to: Littlerubarbwk
It shouldn't. I tried it against a Web Service with the table in SQL Sever with no problems.

Public Sub SetMyLayers()
Dim ws As New longhorn.Service
Dim dt As System.Data.DataTable = ws.Layers.Tables(0)
Dim dv As New DataView(dt)
Dim drv As DataRowView
For Each drv In dv
Select Case drv("LayerDescription")
Case "Visible"
visibleId = CheckForLayer(drv("LayerName"), drv("LayerColor"), drv("LayerLinetype"))
Case "Center"
centerId = CheckForLayer(drv("LayerName"), drv("LayerColor"), drv("LayerLinetype"))
Case "Dimension"
dimensionId = CheckForLayer(drv("LayerName"), drv("LayerColor"), drv("LayerLinetype"))
Case "Hidden"
hiddenId = CheckForLayer(drv("LayerName"), drv("LayerColor"), drv("LayerLinetype"))
Case "Main Part"
partId = CheckForLayer(drv("LayerName"), drv("LayerColor"), drv("LayerLinetype"))
Case "Secondary Part"
part2Id = CheckForLayer(drv("LayerName"), drv("LayerColor"), drv("LayerLinetype"))
Case "Motion"
movementId = CheckForLayer(drv("LayerName"), drv("LayerColor"), drv("LayerLinetype"))
Case "Interface1 Equipment"
interfaceequipId = CheckForLayer(drv("LayerName"), drv("LayerColor"), drv("LayerLinetype"))
Case "Interface2 Equipment"
interfaceequip2Id = CheckForLayer(drv("LayerName"), drv("LayerColor"), drv("LayerLinetype"))
Case "Ball-n-Stock"
balloonId = CheckForLayer(drv("LayerName"), drv("LayerColor"), drv("LayerLinetype"))
Case Else
CheckForLayer(drv("LayerName"), drv("LayerColor"), drv("LayerLinetype"))
End Select
Next
End Sub
Active Contributor
Littlerubarbwk
Posts: 38
Registered: ‎09-08-2006
Message 14 of 15 (53 Views)

Re: Add Linetype to Layer

09-20-2006 07:26 AM in reply to: Littlerubarbwk
Thanks for your continued assistance, I'm posting the refined code if you can see anything that jumps out as wrong please let me know, I going to try refining some more?
Active Contributor
Littlerubarbwk
Posts: 38
Registered: ‎09-08-2006
Message 15 of 15 (53 Views)

Re: Add Linetype to Layer

09-25-2006 02:39 PM in reply to: Littlerubarbwk
I solved It, After all the searching I went back to the dataset and found some spelling errors in the linetype idenification.. I feel so stupid..Thanks for all your help..

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community