Change linetype

Hello all,

I am new to Bricscad development and I have a simple question.

I want to change the linetype of a Line object to some predefined linetype (for example "Center").
I tried code that works on Autocad, but i am getting eNoDatabase exception. I have changed input file in code to "iso.lin" and "default.lin" but no success.

Can someone write me a piece of code that changes the linetype of any object in C# preferably(or any other language)?

Thanks very much!

Regards,
Dusan

Comments

  • Before a linetype can be used it has to be defined in the drawing.

    Lisp example:
    [code](vla-load
      (vla-get-linetypes (vla-get-activedocument (vlax-get-acad-object)))
      "Center"
      (findfile "iso.lin")
    )
    (vla-put-linetype lineObject "Center")[/code]
  • Or (to account for the measurement variable):
    [code](vla-load
      (vla-get-linetypes (vla-get-activedocument (vlax-get-acad-object)))
      "Center"
      (findfile
        (if (zerop (getvar 'measurement)) "default.lin" "iso.lin")
      )
    )
    (vla-put-linetype lineObject "Center")[/code]
This discussion has been closed.