Page 1 of 1

Different layers in the same blocks.

Posted: Tue Feb 25, 2003 9:30 am
by andreadiloreto
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

Posted: Tue Feb 25, 2003 7:55 pm
by John Finlay
What do you want to do?

1/ Insert a block on a different layer?

2/ Alter an existing block's layer?

3/ Change the layer of a drawing entity inside an existing block?

I'm not sure what you need; could you please explain further.



------------------
Regards
John Finlay

Posted: Wed Feb 26, 2003 12:42 am
by andreadiloreto
First condition:
Insert a block on a different layer.

Regards

Posted: Sat Mar 01, 2003 11:13 pm
by John Finlay
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