See the top rated post in this thread. Click here

Results 1 to 4 of 4

Thread: Text String Error in an AutoCAD Script:

  1. #1
    Member
    Join Date
    2008-05
    Posts
    11
    Login to Give a bone
    0

    Default Text String Error in an AutoCAD Script:

    Text String Error in an AutoCAD Script:

    I'm creating a script for AutoCAD. When entering text strings in a script, I’m unsure how to insert an "Enter" that AutoCAD will recognize as the end of the text string so it can continue executing the script.

    In the following script, I want the "Enter" to be placed after the word _construir:

    Spaces don't work, neither do double quotes "", and /n doesn't work either.

    -layer new "CV-DRNG-GENL-CONS" Plot N "CV-DRNG-GENL-CONS" color 140 "CV-DRNG-GENL-CONS" ltype CONTINUOUS "CV-DRNG-GENL-CONS" lweight 0.20 "CV-DRNG-GENL-CONS" Transparency 0 "CV-DRNG-GENL-CONS" Description "Red_general_de_aguas_lluvias_a_construir " " " "CV-DRNG-GENL-CONS"

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,745
    Login to Give a bone
    0

    Default Re: Text String Error in an AutoCAD Script:

    Code:
    -layer
    new
    "CV-DRNG-GENL-CONS"
    Plot
    N
    "CV-DRNG-GENL-CONS"
    color
    140
    "CV-DRNG-GENL-CONS"
    ltype
    CONTINUOUS
    "CV-DRNG-GENL-CONS"
    lweight
    0.20
    "CV-DRNG-GENL-CONS"
    Transparency
    0
    "CV-DRNG-GENL-CONS"
    Description
    Red_general_de_aguas_lluvias_a_construir
    "CV-DRNG-GENL-CONS"
    *Note the extra lines at the end.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 5860, Xeon W7-2495X, 128GB RAM, Dual PCIe 4.0 M.2 SSD (RAID 0), 20GB NVIDIA RTX 4000 ADA

  3. #3
    Member
    Join Date
    2008-05
    Posts
    11
    Login to Give a bone
    0

    Default Re: Text String Error in an AutoCAD Script:

    the script keeps asking the same thing, after the description the autocad does not identify when the description text ends and it must continue executing the script
    Code:
    SCRIPT
    Command: -LAYER
    Current layer:  "0"
    Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/PStyle/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]: N
    Enter name list for new layer(s): "Jose2" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/PStyle/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]: C
    New color [Truecolor/COlorbook] : 174
    Enter name list of layer(s) for color 174 <0>: "Jose2" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/PStyle/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]: LT
    Enter loaded linetype name or [?] <Continuous>: HIDDEN
    Enter name list of layer(s) for linetype "HIDDEN" <0>: "Jose2" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/PStyle/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]: LW
    Enter lineweight (0.0mm - 2.11mm): 0.20
    Enter name list of layers(s) for lineweight 0.20mm <0>: "Jose2" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/PStyle/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]: D
    Enter layer description: Cerramiento_en_malla_eslabonada_ilustrativo_a_construir
    
    Enter name list of layer(s) to apply description or <select objects>:  <*>:
    Last edited by BlackBox; 2024-11-06 at 11:23 AM. Reason: Please use [CODE] Tags

  4. #4
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,745
    Login to Give a bone
    1

    Default Re: Text String Error in an AutoCAD Script:

    Works fine here (with the extra lines at the end):

    Script (two empty lines at the end, to end the -LAYER Command):
    Code:
    -layer
    new
    "Jose2"
    Plot
    N
    "Jose2"
    color
    174
    "Jose2"
    ltype
    HIDDEN
    "Jose2"
    lweight
    0.20
    "Jose2"
    Description
    Cerramiento_en_malla_eslabonada_ilustrativo_a_construir
    "Jose2"

    Command line:
    Code:
    Command: _SCRIPT
    <snip>
    
    
    Command: -layer
    
    
    Current layer:  "0"
    Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]: new
    
    
    Enter name list for new layer(s): "Jose2"
    Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]: Plot
    
    
    Enter a plotting preference [Plot/No plot] <Plot>: N
    
    
    Enter layer name(s) for this plot preference <0>: "Jose2"
    Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]: color
    
    
    New color [Truecolor/COlorbook] : 174
    
    
    Enter name list of layer(s) for color 174 <0>: "Jose2"
    Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]: ltype
    
    
    Enter loaded linetype name or [?] <Continuous>: HIDDEN
    
    
    Enter name list of layer(s) for linetype "HIDDEN" <0>: "Jose2"
    Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]: lweight
    
    
    Enter lineweight (0.0mm - 2.11mm): 0.20
    
    
    Enter name list of layers(s) for lineweight 0.20mm <0>: "Jose2"
    Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]: Description
    
    
    Enter layer description: Cerramiento_en_malla_eslabonada_ilustrativo_a_construir
    
    
    Enter name list of layer(s) to apply description or <select objects>:  <*>: "Jose2"
    Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]:
    
    
    Command:
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 5860, Xeon W7-2495X, 128GB RAM, Dual PCIe 4.0 M.2 SSD (RAID 0), 20GB NVIDIA RTX 4000 ADA

Similar Threads

  1. how to replace only a single string by pre decided string.
    By mohammad.raees637333 in forum AutoLISP
    Replies: 3
    Last Post: 2014-04-22, 01:07 PM
  2. error: malformed string on input
    By Bear31831 in forum AutoCAD General
    Replies: 13
    Last Post: 2013-08-27, 06:50 PM
  3. "string too long" error
    By jim.elfering in forum Inventor - General
    Replies: 0
    Last Post: 2007-02-28, 01:23 PM
  4. Lisp to extract and add numbers from text/mtext string
    By cblendermann.91943 in forum AutoLISP
    Replies: 26
    Last Post: 2005-08-18, 03:25 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
  •