BeginCommand-statement

In Bricscad V9 the following (simplified) code in the ThisDrawing-Module worked (it should manage to

switch the aktive Layer when the Xline-command is triggered):

------------------------------------------------------------------------------------------------

Public WithEvents AktivesDokumentObjekt As AcadDocument

Public Sub Init()  '...Initialize AcadDocumet

Set AktivesDokumentObjekt=ThisDrawing.Application.ActiveDocument

End Sub

Private Sub AktivesDokumentObjekt_BeginnCommand (ByVal Commandname As String)

SelectCase Commandname

Case "XLINE"

ThisDrawing.ActiveLayer=ThisDrawing.Layers("FC-S-Hilfslinie")

EndSelect

End sub

--------------------------------------------------------------------

In V10 it doesnt work any more ! What has changed ?

kind regards from Austria

Peter Schriebl

Comments

  • Hi,
    You wrote: "In V10 it doesnt work any more ! What has changed ?"

    Not sure, but perhaps your spelling has evolved...?:
    you wrote:
    Private Sub AktivesDokumentObjekt_BeginnCommand (ByVal Commandname As String)

    I believe it should be:

    Private Sub AktivesDokumentObjekt_BeginCommand(ByVal Commandname As String)
    in other words change
    _BeginnCommand
    to
    _BeginCommand

    Seems to work for me...

  • Hi,

    After checking the spelling (its ok in the original-code) I could figure out, that the line

    "Set AktivesDokumentObjekt = ThisDrawing.Application.ActiveDocument"

    causes an error like "Typen unverträglich" (errcode=13)

    Have I made a mistake in the declaration of the "AktivesDokumentObjekt"?

    regards from Austria

    Peter Schriebl

This discussion has been closed.

Welcome!

It looks like you're new here. Sign in or register to get started.