Author Topic: Label View Layer when placing view from SSM  (Read 89 times)

0 Members and 1 Guest are viewing this topic.

jpcadconsulting

  • Newt
  • Posts: 55
Label View Layer when placing view from SSM
« on: February 12, 2020, 03:06:17 PM »
Hiya gang,

I have been using Lee Mac's Layer Director to get the SSM callouts and vieworts onto the correct layers.

It's working mostly. But the View Label that is inserted as part of placing the view still winds up on the current layer.

Here are the added codes in Layer Director:

Code: [Select]
("*CALLOUT*"             "L-ANNO-SYMB"      "Annotations - Symbols"                             3        "Continuous"           -3                 1                 nil         )
("*VIEWLABEL*"           "L-ANNO-SYMB"    "Annotations - Symbols"                                       3        "Continuous"           -3                 1                 nil         )

These work great, placing the callouts and the view label (when manually placed from the SSM) onto L-ANNO-SYMB.



Code: [Select]
("*PLACEVIEW*"             "L-PS-VPORT"      "Paper Space - Viewport, NO PLOT"                             5        "Continuous"           -3                 0                 nil         )
This also works great, placing the viewport on L-PS-VPORT when placing a view.


However, the View Label that is placed with the viewport still goes on the current layer.

Is PLACEVIEW calling some other command besides VIEWLABEL to place the view label? Or is the insertion of that view label integral to the PLACEVIEW command so it's never triggering the VIEWLABEL reactor?

I'm going bonkers trying to get this last bit to work... so any help is as always, much appreciated.

-JP

Technology will save us all! *eyeroll*

jpcadconsulting

  • Newt
  • Posts: 55
Re: Label View Layer when placing view from SSM
« Reply #1 on: February 18, 2020, 02:49:52 PM »
OK, did some more sleuthing using Lee Mac's code Modified thusly:


Code: [Select]
; Layer Director by Lee McDonnell (MODIFIED)

(vl-load-com)

(if (not cmdReactor)
   (setq cmdReactor
        (vlr-command-reactor
        nil
        '((:vlr-commandWillstart . startCommand)
          (:vlr-commandEnded . endcommand)
          (:vlr-commandCancelled . cancelCommand)
         )
        ) ; end command reactor
   ) ; end setq
) ; end if

(defun startCommand (calling-reactor startcommandInfo / thecommandstart)
   (setq oldlay (getvar "clayer"))
   (setq thecommandstart (car startcommandInfo))
   (if    (= thecommandstart "PLACEVIEW")
   (setvar "clayer" "L-PS-VPORT")
   ) ;_  end if
   (princ)
) ; end startcommand

(defun endCommand (calling-reactor endcommandInfo / thecommandend)
   (setq thecommandend (car endcommandInfo))
   (if    (= thecommandend "PLACEVIEW")
   ---->(alert "PLACEVIEW DONE!")<-----
   ) ;_  end if
   (princ)
) ; end endCommand

(defun cancelCommand (calling-reactor cancelcommandInfo / thecommandcancel)
   (setq thecommandcancel (car cancelcommandInfo))
   (if    (= thecommandcancel "INSERT")
   (setvar "clayer" oldlay)
   ) ;_  end if
   (princ)
) ; end cancelCommand

This creates a dialog box when the PLACEVIEW command completes.  As you can see, the PLACEVIEW command completes prior to the view label being placed.

See attached image "PV1.png"

After clicking 'OK' the view label is placed.

See attached image "PV2.png"

So I guess what I need to know is what command is issued after PLACEVIEW that inserts the viewlabel, and if that command is VIEWLABLE, why is the reactor not grabbing it?



Thanks as always for your help folks
Technology will save us all! *eyeroll*