pumpkin
2014-03-10, 08:36 PM
Hi
I need some help
I try to create list of layer from a files, but I don't understand the Do /While and I have a message error like missing information for the creation of layer
Ex. of my list files
;Layername, colour,linetype
*Layer1
layer1a,7,continuous
Layer1b,12,hidden
*layer2
layer2a,70,continous
Layer2b,82,hidden
The code I have from now
Dim sTemp As String
Dim sTemp1 As String
Dim nFile As Integer
Dim sLAYER As String
Dim sColor As String
Dim sLinetype As String
Dim objLayer As AcadLayer
sTemp = ListBox1.Text
nFile = FreeFile
Open sFile For Input As #nFile
While Not EOF(nFile)
Line Input #nFile, sTemp1
If sTemp1 = "*" & sTemp Then
Input #nFile, sLAYER, sColor, sLinetype
Set objLayer = ThisDrawing.Layers.Add(sLAYER)
objLayer.color = sColor
objLayer.Linetype = sLinetype
End If
Wend
So is there someone could tell me how fix it
Thanks!
I need some help
I try to create list of layer from a files, but I don't understand the Do /While and I have a message error like missing information for the creation of layer
Ex. of my list files
;Layername, colour,linetype
*Layer1
layer1a,7,continuous
Layer1b,12,hidden
*layer2
layer2a,70,continous
Layer2b,82,hidden
The code I have from now
Dim sTemp As String
Dim sTemp1 As String
Dim nFile As Integer
Dim sLAYER As String
Dim sColor As String
Dim sLinetype As String
Dim objLayer As AcadLayer
sTemp = ListBox1.Text
nFile = FreeFile
Open sFile For Input As #nFile
While Not EOF(nFile)
Line Input #nFile, sTemp1
If sTemp1 = "*" & sTemp Then
Input #nFile, sLAYER, sColor, sLinetype
Set objLayer = ThisDrawing.Layers.Add(sLAYER)
objLayer.color = sColor
objLayer.Linetype = sLinetype
End If
Wend
So is there someone could tell me how fix it
Thanks!