Results 1 to 4 of 4

Thread: Use of Code DXF 340 to create complex LTYPE wtih Entmake.

  1. #1
    100 Club jeanpaul.remacle's Avatar
    Join Date
    2001-08
    Location
    Belgique
    Posts
    176
    Login to Give a bone
    0

    Question Use of Code DXF 340 to create complex LTYPE wtih Entmake.

    Hi,
    I have trouble with use of code dxf 340 with LTYPE.
    I need to create a line like "--> TD > -- " .
    But my lisp does't work with this complexe line.
    For the complexe line, a Text Style is create with the lisp.
    For a simple line, my code work fine.
    Thanks for your help

    Code:
    (DEFUN c:Init_Ligne (/ MonCalque aa zz ee plot no_plot)
    
    ;;;; Create Text Style
      
      (DEFUN Creation_Style	(Nom_Style Hauteur_Style Police_Style)
        (ENTMAKE (LIST
    	       (CONS 0 "STYLE")
    	       (CONS 100 "AcDbSymbolTableRecord")
    	       (CONS 100 "AcDbTextStyleTableRecord")
    	       (CONS 2 Nom_Style)
    	       (CONS 70 0)
    	       (CONS 40 Hauteur_Style)
    	       (CONS 41 1.0)
    	       (CONS 50 0.0)
    	       (CONS 71 0)
    	       (CONS 42 0.2)
    	       (CONS 3 Police_Style)
    	       (CONS 4 "")
    	     ) ;_ Fin de List
        ) ;_ Fin de ENTMAKE
      ) ;_ Fin de defun
    
      (Creation_Style "Arial_014" 7.0 "arial.ttf")
    
    ;;; Création des LTYPE
    
      (IF (= (TBLOBJNAME "LTYPE" "CACH") nil)
        (ENTMAKE (LIST '(0 . "LTYPE")
    		   '(100
    		     .
    		     "AcDbSymbolTableRecord"
    		    )
    		   '(100
    		     .
    		     "AcDbLinetypeTableRecord"
    		    )
    		   '(2 . "Cach")
    		   '(70 . 0)
    		   '(3
    		     .
    		     "Cach \(.5x\)- - -"
    		    )
    		   '(72 . 65)
    		   '(73 . 2)
    		   '(40 . 13.0)
    		   '(49 . 10.0)
    		   '(74 . 0)
    		   '(49 . -3.0)
    		   '(74 . 0)
    	     ) ;_ Fin de list
        ) ;_ Fin de entmake
      ) ;_ Fin de if
    
    
      (IF (= (TBLOBJNAME "LTYPE" "TD") nil)
        (ENTMAKE
          (LIST '(0 . "LTYPE")
    	    '(100 . "AcDbSymbolTableRecord")
    	    '(100 . "AcDbLinetypeTableRecord")
    	    '(2 . "TD")
    	    '(70 . 0)
    	    '(3 . "____ . . > TD > . . ____")
    	    '(72 . 65)
    	    '(73 . 12)
    	    '(40 . 107.5)
    	    '(49 . 62.5)
    	    '(74 . 0)
    	    '(49 . -5.0)
    	    '(74 . 0)
    	    '(49 . 0.0)
    	    '(74 . 0)
    	    '(49 . -5.0)
    	    '(74 . 0)
    	    '(49 . 0.0)
    	    '(74 . 2)
    	    '(75 . 0)
    	    (CONS 340 (TBLOBJNAME "STYLE" "Arial_014"))    ;;;Style in use
    	    '(46 . 1.0)
    	    '(50 . 0.0)
    	    '(44 . 0.0)
    	    '(45 . -3.5)
    	    '(9 . "> TD >")
    	    '(49 . -20.0)
    	    '(74 . 0)
    	    '(49 . 0.0)
    	    '(74 . 0)
    	    '(49 . -5.0)
    	    '(74 . 0)
    	    '(49 . 0.0)
    	    '(74 . 0)
    	    '(49 . -5.0)
    	    '(74 . 0)
    	    '(49 . 0.0)
    	    '(74 . 0)
    	    '(49 . -5.0)
    	    '(74 . 0)
    
          ) ;_ Fin de list
        ) ;_ Fin de entmake
      ) ;_ Fin de if  
    
      (PRINC "\nCréation de Lignes effectuée!")
      (PRINC)
    ) ;_ Fin de Defun
    ;|«Visual LISP© Format Options»
    Last edited by rkmcswain; 2018-12-21 at 04:14 PM. Reason: Added [CODE] tags
    --
    Jean-Paul Remacle.
    (AutoCAD Revit Architecture Suite 2009(x64) à cause de ce bug http://revitauquotidien.blogspot.com...presentee.html
    2013(x64) - Vista (x64)
    http://revitauquotidien.blogspot.com/

  2. #2
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL
    Posts
    2,992
    Login to Give a bone
    0

    Default Re: Use of Code DXF 340 to create complex LTYPE wtih Entmake.

    I use macros that include one lisp like you do to add the Text Style if needed, but use Lee Mac's LoadLinetypesV1-1.lsp from http://www.lee-mac.com/programs.html to load a group of linetype from any LIN file in the Support Path.
    Code:
     (or LM:LoadLinetypes (load "LoadLinetypesV1-1.lsp"))(LM:LoadLinetypes '("ArialDOT" "ArialDOT2" "ArialDOTX2" "ArialARROW") T)
    Much easier than trying to recreate them with lisp.
    Tom Beauford P.S.M. - Civil 2019 on Windows 10 Enterprise
    Design Analysis - Leon County Public Works/Engineering Wrap [CODE] tags around selected text
    2280 Miccosukee Rd. Tallahassee, FL 32308-5310
    Ph# (850)606-1516 Home Page

  3. #3
    100 Club
    Join Date
    2002-08
    Posts
    177
    Login to Give a bone
    0

    Default Re: Use of Code DXF 340 to create complex LTYPE wtih Entmake.

    Hi,
    I have try in lisp but I don't have succes. I don't know if use dictionnary or xrecord for obtain a result.
    But I have read this blog, and can be a solution for you.

  4. #4
    100 Club
    Join Date
    2002-08
    Posts
    177
    Login to Give a bone
    0

    Default Re: Use of Code DXF 340 to create complex LTYPE wtih Entmake.

    Or in lisp, perhaps by this way. Seem to work's.
    Exemple for an another definition : transport

    Code:
    ((lambda ( / f_lin doc loaded)
      (if (not (tblsearch "STYLE" "TRANSPORT"))
        (entmakex
          '(
            (0 . "STYLE")
            (5 . "40")
            (100 . "AcDbSymbolTableRecord")
            (100 . "AcDbTextStyleTableRecord")
            (2 . "TRANSPORT")
            (70 . 0)
            (40 . 0.0)
            (41 . 1.0)
            (50 . 0.0)
            (71 . 0)
            (42 . 1.0)
            (3 . "ARIAL.TTF")
            (4 . "")
           )
        )
      )
      (if (not (findfile "transport.lin"))
        (progn
          (setq f_lin (open (strcat (getvar "ROAMABLEROOTPREFIX") "support\\transport.lin") "w"))
          (write-line "*transport,alterné" f_lin)
          (write-line "A,0,[\"\\U+25A0\",transport,S=1,R=0,X=-0.595,Y=-0.3215],-0.6435,[\"\\U+25A1\",transport,S=1,R=0,X=-0.595,Y=-0.3215],-0.6435" f_lin)
          (close f_lin)
        )
      )
      (setq doc (vla-get-activedocument (vlax-get-acad-object)))
      (if
        (and
          (not
            (vlax-for item (vla-get-linetypes doc)
              (if (= (strcase (vla-get-name item)) (strcase "transport")) T)
            )
          )
          (vl-catch-all-error-p
            (vl-catch-all-apply
              'vla-load
              (list (vla-get-Linetypes doc) "transport" "transport.lin")
            )
          )
        )
        nil
        T
      )
      (princ "\nCréation de Type de Ligne \"transport\" effectué!")
      (prin1)
    ))

Similar Threads

  1. Replies: 19
    Last Post: 2010-09-14, 04:00 PM
  2. trying to use entmake to create a mlinestyle
    By d_m_hopper in forum AutoLISP
    Replies: 3
    Last Post: 2009-01-19, 02:29 PM
  3. Create Mtext with entmake
    By TobyKanoby in forum AutoLISP
    Replies: 7
    Last Post: 2007-06-07, 08:19 AM
  4. Using entmake to create a block
    By t-bone67 in forum AutoLISP
    Replies: 1
    Last Post: 2005-06-06, 06:08 PM
  5. Using entmake to create (redefine) Blocks
    By melkor in forum AutoLISP
    Replies: 2
    Last Post: 2005-01-26, 11:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •