Jump to content


VB nanoCAD.Document.SendCommand("-layer")


  • You cannot reply to this topic
No replies to this topic

#1 Pape

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 20 June 2016 - 07:59 AM

[THIS IS SOLVED]

Hi users of NanoCAD Forum,

i use NanoCAD 5.0 and try to start a macro to turn layers off or on.
I try the nanoCAD.Document.SendCommand() in VB.

Imports nanoCAD
Dim napp As nanoCAD.Application
Dim ndoc As nanoCAD.Document
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
napp = New nanoCAD.Application 'nanocad have to be open with document'
ndoc = napp.ActiveDocument
'all Layer off'
ndoc.SendCommand("-layer;_off;*;;")'DOESN T WORK'
ndoc.SendCommand("-layer" & Chr(13) & "OFF" & Chr(13) & "*" & Chr(13) & "NO" & Chr(13) & Chr(13))'DOESN T WORK'
End Sub

What i am doing wrong?

I got a solution!

This is now working for me.
ndoc.SendCommand("-LAYER" & vbCr & "OFF" & vbCr & "*" & vbCr & "YES" & vbCr & vbCr)

Thanks the examples from other members.
greeting from Germany

Edited by Pape, 23 August 2016 - 05:29 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users