Author Topic: layerdirector : help with external reference  (Read 4297 times)

0 Members and 1 Guest are viewing this topic.

lamarn

  • Swamp Rat
  • Posts: 636
layerdirector : help with external reference
« on: September 17, 2012, 03:46:37 AM »
I use Lee mac's layerdirector. It works great, but i would like this routine to handle my xref objects as well.
The thing is i do not know how object 'external reference' is called upon lisp-wise.

Does anyone know how this can be done?

See beneath part of the code.

(setq *LayerDirector-LayerData*
   '(
        ("[DM]TEXT,TEXT"   "TEXT"      )
        ("DIM*,*LEADER"    "DIMENSIONS")
        ("*VPORT*"         "DEFPOINTS" )
        ("*?? name for xrefs ??*  "XREF")
    )

http://www.lee-mac.com/lisp/html/LayerDirectorV1-1.html



Design is something you should do with both hands. My 2d hand , my 3d hand ..

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: layerdirector : help with external reference
« Reply #1 on: September 17, 2012, 04:32:02 AM »
If you analyse the code you will find that Lee has added a "Print Command Debug Mode".
If you change:
Code - Auto/Visual Lisp: [Select]
  1. (setq *PrintCommand* nil)
To:
Code - Auto/Visual Lisp: [Select]
  1. (setq *PrintCommand* T)
You will be able to find the commands you are looking for.
And with these commands you can create your own sublist to add to *LayerDirector-LayerData*:
Code - Auto/Visual Lisp: [Select]
  1. ("*XREF"  "XREF")
The first part of the sublist is a wcmatch string that matches one or more command names.
« Last Edit: September 17, 2012, 04:43:01 AM by roy_043 »

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: layerdirector : help with external reference
« Reply #2 on: September 17, 2012, 06:26:16 AM »
Thank you for assisting roy, I appreciate it  :-)

lamarn

  • Swamp Rat
  • Posts: 636
Re: layerdirector : help with external reference
« Reply #3 on: September 18, 2012, 05:25:35 PM »
Thank you!
Design is something you should do with both hands. My 2d hand , my 3d hand ..

Birdy

  • Guest
Re: layerdirector : help with external reference
« Reply #4 on: June 07, 2013, 06:45:11 PM »
Lee;
testing this out, and I cannot seem to get the Layer Data to work for Color and other Layer properties when the layer does not exist in the drawing.
what is the format in the layer data list for properties other than layer name?


Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: layerdirector : help with external reference
« Reply #5 on: June 07, 2013, 06:52:30 PM »
Lee;
testing this out, and I cannot seem to get the Layer Data to work for Color and other Layer properties when the layer does not exist in the drawing.
what is the format in the layer data list for properties other than layer name?

Hi Jim,

Unfortunately layer properties are not supported in the current version of the program; the Layer Data list requires only a command name pattern and associated layer name to be set when the command name is matched. If I get some spare time, I may look to update the program to incorporate other layer properties in this list.

Lee

Birdy

  • Guest
Re: layerdirector : help with external reference
« Reply #6 on: June 07, 2013, 07:07:17 PM »
That's cool.
It works great in our template where all the layers exist.
Very nice work Lee. You continually amaze me.  :-)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: layerdirector : help with external reference
« Reply #7 on: June 07, 2013, 11:16:37 PM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Birdy

  • Guest
Re: layerdirector : help with external reference
« Reply #8 on: June 08, 2013, 09:55:13 AM »
Thanks CAB, I will check that one out.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: layerdirector : help with external reference
« Reply #9 on: June 09, 2013, 12:36:06 PM »
That's cool.
It works great in our template where all the layers exist.
Very nice work Lee. You continually amaze me.  :-)

Thanks Jim, I appreciate your compliments  :-)

lamarn

  • Swamp Rat
  • Posts: 636
Re: layerdirector : help with external reference
« Reply #10 on: July 17, 2015, 05:19:53 AM »
I made three videos on YouTube to explain the advantages of lm:layerdirector. Search for them on YouTube. I made them to help me and hopefully others with layering bs. Works
Design is something you should do with both hands. My 2d hand , my 3d hand ..

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: layerdirector : help with external reference
« Reply #11 on: July 17, 2015, 09:03:22 AM »
I made three videos on YouTube to explain the advantages of lm:layerdirector. Search for them on YouTube. I made them to help me and hopefully others with layering bs. Works

Thank you Hans! - Your videos are excellent  :-)

lamarn

  • Swamp Rat
  • Posts: 636
Re: layerdirector : help with external reference
« Reply #12 on: December 03, 2015, 05:06:13 AM »
Lee,

Thanks for updating the code to v1.3. Excellent work!
These aditional options are very welcome.
http://www.lee-mac.com/layerdirector.html

I have a little question.
Say i want to use my own command to work with layer director. How can this be made possible?

defun c:1
command : pline
..


« Last Edit: January 13, 2016, 04:37:12 PM by lamarn »
Design is something you should do with both hands. My 2d hand , my 3d hand ..

lamarn

  • Swamp Rat
  • Posts: 636
Re: layerdirector : help with external reference
« Reply #13 on: January 13, 2016, 04:36:42 PM »
Mr. Lee Mac updated the code (v1.4) and i am happy  :2funny: to find that now it is more than easy to apply layerdefinitions to custom commands.

https://youtu.be/ZSDbiZgHGnI

Example, not the most sifit

Code: [Select]
layerdirector:data
   '(
                           
;;-----------------------------------------------------------------------------------------------------------------------------------------------------;;
;;  Command Pattern  |  Layer Name    |       Description       |    Colour    |   Linetype   |    Lineweight    |       Plot       |    Plot Style    ;;
;;-----------------------------------------------------------------------------------------------------------------------------------------------------;;
;;     [string]      |   [string]     |         [string]        | 0 < int <256 |   [string]   | -3 = Default     |  1 = Will Plot   |     [string]     ;;
;;                   |                |     Use "" for none     |              |              |  0 <= int <= 211 |  0 = Won't Plot  |  Use nil for CTB ;;
;;-----------------------------------------------------------------------------------------------------------------------------------------------------;;



 ;; e.e.a. zoals  NLCS stijl

("[DM]TEXT,TEXT"    "X-XX_txt__"    "NLCS text"    7 "Continuous"    25 1 nil ) ; text
("DIM*"            "X-XX_dim_" "NLCS dimension" 7 "Continuous"  25 1 nil ) ; dims
("*VPORT*"          "vports" "NLCS viewport" 9 "Continuous" 13 0 nil ) ; vport
("*LEADER*"        "X-XX_ldr_" "NLCS leader" 7 "Continuous" 25 1 nil) ; leader
("*XLINE*"          "X-XX_hulplijn_" "NLCS hulp" 6 "Continuous" 13 0 nil) ; xlines
("*RAY*"            "X-XX_hulplijn_"  "NLCS hulp" 6 "Continuous" 13 0 nil) ; ray
("*XREF*"          "xref" "NLCS xref" 7 "Continuous" -3 1 nil) ; references
("*WIPEOUT*"        "X-XX_wipeout" "NLCS wipeout" 7 "Continuous" 13 1 nil) ; for wipeouts
("*HATCH*"          "X-XX_hatch-AD" "NLCS hatch" 253 "Continuous" 18 1 nil) ; for hatches
("*image*"          "X-XX_image_" "NLCS image" 7 "Continuous" 13 1 nil) ; for images
 
     
("*3dface*"        "_3D_face_"     "3D face"  4 "Continuous" 35 1 nil) ; faces
("*EXTRUDE*"      "_3D_solid_extrude_" "3D extrude" 4 "Continuous" 35 1 nil) ; extrude
("*REVOLVE*"        "_3D_solid_revolve_"  "3D revolve" 4 "Continuous" 35 1 nil)      ; revolved
("*SWEEP*"          "_3D_solid_sweep_"    "3D sweep" 3 "Continuous" 35 1 nil)      ; sweeps
("*LOFT*"          "_3D_solid_loft_"    "3D loft" 3 "Continuous" 35 1 nil)      ; sweeps
("*POLYSOLID*"          "_3D_solid_poly_"    "3D poly" 3 "Continuous" 35 1 nil)      ; sweeps
("*section*"          "_3D_section__"    "3D section" 125 "Continuous" 25 0 nil)      ; sections
("*sectionplane*"       "_3D_sectionplane__"    "3D sectionplane" 114 "Continuous" 25 0 nil)      ; sectionplane

; custom command  === > HERE IS WHERE THE REAL MAGIC HAPPENS .. :)
     
("DNH"        "X-XX_dim_DNH"    "none-NLCS DNH hoogtemaatvoering"    7 "Continuous" 18 1 nil)
("DNHmm"        "X-XX_dim_DNH"    "none-NLCS DNH hoogtemaatvoering"    7 "Continuous" 18 1 nil)
("DNHm"        "X-XX_dim_DNH"    "none-NLCS DNH hoogtemaatvoering"    7 "Continuous" 18 1 nil)     
("inladenblock" "X-XX_dim_DNH" "none-NLCS DNH hoogtemaatvoering" 7 "Continuous" 18 1 nil)
("4PS"        "_3D_4-point-solid_"    "none-NLCS 4-point solid"    7 "Continuous" 18 1 nil)
("talud"      "talud" "none-NLCS talud" 1 "Continuous" 18 1 nil)
("0"        "0"    "none-NLCS" 7 "Continuous" 18 1 nil)     
("1"        "1"    "none-NLCS" 1 "Continuous" 18 1 nil)
("1d"        "1d"    "none-NLCS" 1 "DOT5" 18 1 nil)
("1h"        "1h"    "none-NLCS" 1 "HIDDEN5" 18 1 nil)     
("1c"        "1c"    "none-NLCS" 1 "CENTER2" 18 1 nil)
("1a"        "1"    "none-NLCS" 1 "DASHDOT2" 18 1 nil)
("2"        "2"    "none-NLCS" 2 "Continuous" 25 1 nil)
("2h"        "2h"    "none-NLCS" 2 "HIDDEN5" 25 1 nil)
("2c"        "2c"    "none-NLCS" 2 "CENTER2" 25 1 nil)
("2a"        "2a"    "none-NLCS" 2 "DASHDOT2" 25 1 nil)     
("3"        "3"    "none-NLCS" 3 "Continuous" 35 1 nil)     
("3h"        "3h"    "none-NLCS" 3 "HIDDEN5" 35 1 nil)
("3c"        "3c"    "none-NLCS" 3 "CENTER2" 35 1 nil)     
("3a"        "3a"    "none-NLCS" 3 "DASHDOT2" 35 1 nil)     
("4"        "4"    "none-NLCS" 4 "Continuous" 50 1 nil)     
("4d"        "4h"    "none-NLCS" 4 "DOT5" 50 1 nil)
("4h"        "4h"    "none-NLCS" 4 "HIDDEN5" 50 1 nil)
("4c"        "4c"    "none-NLCS" 4 "CENTER2" 50 1 nil)
("4a"        "4a"    "none-NLCS" 4 "DASHDOT2" 50 1 nil)
("5"        "5"    "none-NLCS" 5 "Continuous" 70 1 nil)     
("6"        "6"    "none-NLCS" 6 "Continuous" 100 1 nil)     
("7"        "7"    "none-NLCS" 7 "Continuous" 25 1 nil)     
("8"        "8"    "none-NLCS" 8 "Continuous" 25 1 nil)     
("9"        "9"    "none-NLCS" 9 "Continuous" 25 1 nil)     
("10"        "10"    "none-NLCS" 10 "Continuous" 25 1 nil)     
("252"        "252"    "none-NLCS" 252 "Continuous" 18 1 nil)     
("253"        "253"    "none-NLCS" 253 "Continuous" 18 1 nil)     
("254"        "254"    "none-NLCS" 254 "Continuous" 18 1 nil)     
     
     ;etc. etc.. apply a layer to your custom command...
     


    )

Code: [Select]
(DEFUN C:LaC ( / )
  (setvar "cmdecho" 0)
  (princ "\nChange entities to current layer: ")
  (SETQ SS1 (SSGET))
  (command "_.chprop" SS1 "" "_layer" (getvar "clayer") "")
  (COMMAND "CHANGE" SS1 "" "PROP" "co" "bylAYER" "")
  (setvar "cmdecho" 1)
  (princ)
  )


(defun c:0 () (c:lac) (princ))
(defun c:1 () (c:lac)  (princ))
(defun c:2 () (c:lac)  (princ))
etc. etc.

Design is something you should do with both hands. My 2d hand , my 3d hand ..