How can I create different layers in the same Block using the InsertBlock method?
I want to use different linetype and thickness in the same block.
I've tried using thickness property in different lines.
Thanks
#4
1/ When you insert the block make sure you have a pointer to the object.
Set myBlock = object.InsertBlock([InsertionPoint], BlockName, [XScale], [YScale], [ZScale], [Rotation])
2/ Make sure the layer exists that you want to place the block on.
You can use my "MakeLayer" Subroutine if you like. Say we want to create a Layer called "FirstBlock"
Use: Makelayer "FirstBlock", 1,"Continuous"
Public Sub MakeLayer(MLayer As String,_ MColour As Integer, MLineType As String)
' This routine will make a layer if the layer is not in drawing with colour and linetype
On Error Resume Next
Dim StrLayTxt As Integer
Dim objMLayer As IntelliCAD.Layer
StrLayTxt = 0
For Each objMLayer In IntelliCAD.ActiveDocument.Layers
If StrComp(objMLayer.Name, MLayer, vbTextCompare) = 0 Then StrLayTxt = 1
Next objMLayer
If StrLayTxt = 0 Then
Set objMLayer = IntelliCAD.ActiveDocument.Layers.Add(MLayer)
objMLayer.Color = MColour
objMLayer.Linetype = MLineType
End If
End Sub
3/ Change the layer property of the block.
Use:
myBlock.Layer = "FirstBlock"
------------------
Regards
John Finlay
Set myBlock = object.InsertBlock([InsertionPoint], BlockName, [XScale], [YScale], [ZScale], [Rotation])
2/ Make sure the layer exists that you want to place the block on.
You can use my "MakeLayer" Subroutine if you like. Say we want to create a Layer called "FirstBlock"
Use: Makelayer "FirstBlock", 1,"Continuous"
Public Sub MakeLayer(MLayer As String,_ MColour As Integer, MLineType As String)
' This routine will make a layer if the layer is not in drawing with colour and linetype
On Error Resume Next
Dim StrLayTxt As Integer
Dim objMLayer As IntelliCAD.Layer
StrLayTxt = 0
For Each objMLayer In IntelliCAD.ActiveDocument.Layers
If StrComp(objMLayer.Name, MLayer, vbTextCompare) = 0 Then StrLayTxt = 1
Next objMLayer
If StrLayTxt = 0 Then
Set objMLayer = IntelliCAD.ActiveDocument.Layers.Add(MLayer)
objMLayer.Color = MColour
objMLayer.Linetype = MLineType
End If
End Sub
3/ Change the layer property of the block.
Use:
myBlock.Layer = "FirstBlock"
------------------
Regards
John Finlay