+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
  1. #1
    Forum Newbie
    Discipline
    Structural
    Using
    AutoCAD 2018
    Join Date
    Nov 2017
    Posts
    9

    Unhappy Make User Variable From Mtxt

    Registered forum members do not see this ad.

    Dear Sir's

    I want to make user variable "Let's say USER1" to be equal to number 15 which is written in txt or mtxt anywhere in my drawing

    so if anyone change this txt or mtxt to 16 the USER1 will be changed to 16 also

    I hope my explanation was clears enough

    thanks and regards

  2. #2
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,821

    Default

    You would be better of with using xdata rather than the USER variables just needs some else code to use it and it wrong.
    A man who never made mistakes never made anything

  3. #3
    Super Moderator SLW210's Avatar
    Computer Details
    SLW210's Computer Details
    Operating System:
    Windows 7 PRO 64-bit
    Computer:
    IBM Lenovo
    Motherboard:
    ACPI x64
    CPU:
    Pentium(R) i5 4570 @ 3.2GHz
    RAM:
    8 GB RAM
    Graphics:
    Nvidia Quadro 600 1GB
    Primary Storage:
    300 GB
    Secondary Storage:
    650GB
    Monitor:
    2x ThinkVision 24"
    Discipline
    Multi-disciplinary
    SLW210's Discipline Details
    Occupation
    Design Draftsman
    Discipline
    Multi-disciplinary
    Details
    Mostly do drafting related to manufacturing. From doing site layouts with proposed updates, additions and renovations to be budgeted and submitted for bid, to updating and changing existing drawings to reflect maintenance and repair/revision work done on site.
    Using
    AutoCAD 2011
    Join Date
    May 2007
    Location
    South Florida, USA
    Posts
    11,799

    Default

    I have moved your thread to the AutoLISP, Visual LISP & DCL Forum, please post in the most appropriate forum.
    “A narrow mind and a fat head invariably come on the same person” Zig Zigler



  4. #4
    Forum Newbie
    Discipline
    Structural
    Using
    AutoCAD 2018
    Join Date
    Nov 2017
    Posts
    9

    Default

    Quote Originally Posted by BIGAL View Post
    You would be better of with using xdata rather than the USER variables just needs some else code to use it and it wrong.
    Dear sir
    Thanks for your help
    here is my full idea
    i made this diesel expression
    $(substr,$(getvar,dwgname),1, $(getvar,"USERI1"))
    i have set custom variable called USERI1 to 11
    so this expression is to give me the first 11 letters in my drawing name

    all i need is to have some flexibility to change the number of letter i get from my drawing name

    i'm not familiar of xdata function

    can i use the xdata with diesel expression and how ?

    Regards

  5. #5
    Super Member
    Computer Details
    tombu's Computer Details
    Operating System:
    Windows 7 64-bit
    Computer:
    Dell
    Discipline
    Civil
    tombu's Discipline Details
    Occupation
    Design Analyst
    Discipline
    Civil
    Details
    Small Street & Stormwater projects. Traffic Calming and other issues.
    Using
    Civil 3D 2018
    Join Date
    Dec 2010
    Location
    Tallahassee, FL USA
    Posts
    729

    Default

    I assign many values to custom Drawing Properties and reference them with fields. Then if I need to change for example the number of pages or name of the engineer of record I simply do it in Drawing Properties and it's updated everywhere automatically. You can do the same with Custom Sheet Set Properties.
    Layer 0 for ByBlock Block entities, everything else ByLayer. So many issues can be solved with good templates.

  6. #6
    Super Member
    Computer Details
    tombu's Computer Details
    Operating System:
    Windows 7 64-bit
    Computer:
    Dell
    Discipline
    Civil
    tombu's Discipline Details
    Occupation
    Design Analyst
    Discipline
    Civil
    Details
    Small Street & Stormwater projects. Traffic Calming and other issues.
    Using
    Civil 3D 2018
    Join Date
    Dec 2010
    Location
    Tallahassee, FL USA
    Posts
    729

    Default

    I've added a drop-down in my Ribbon with lisp macros for the Propulate command like:
    Code:
    ^C^C(command "Propulate" "A" "D:/Users/BeaufordT/AppData/Roaming/Autodesk/VLisp/TomBeauford.prp" "U" "C")
    to set my name as the Drawn by and my boss as the Engineer of Record who's going to sign and seal the drawings.
    Layer 0 for ByBlock Block entities, everything else ByLayer. So many issues can be solved with good templates.

  7. #7
    Super Member
    Using
    not applicable
    Join Date
    Jun 2016
    Posts
    560

    Default

    @MahReda:
    What part of the dwgname do you want to remove?
    Note: You can directly reference the file name without the extension in a field.
    BricsCAD 16

  8. #8
    Forum Newbie
    Using
    AutoCAD 2011
    Join Date
    May 2013
    Posts
    6

    Default

    Quote Originally Posted by MahReda View Post
    Dear Sir's

    I want to make user variable "Let's say USER1" to be equal to number 15 which is written in txt or mtxt anywhere in my drawing

    so if anyone change this txt or mtxt to 16 the USER1 will be changed to 16 also

    I hope my explanation was clears enough

    thanks and regards
    I would suggest using fields like Tombu mentioned.

    Quote Originally Posted by tombu View Post
    I assign many values to custom Drawing Properties and reference them with fields. Then if I need to change for example the number of pages or name of the engineer of record I simply do it in Drawing Properties and it's updated everywhere automatically. You can do the same with Custom Sheet Set Properties.
    This is exactly what we do, custom properties and pieces of text/mtext that have fields that reference the custom properties. I love it, saves so much time.

  9. #9
    Senior Member
    Discipline
    Civil
    Aftertouch's Discipline Details
    Discipline
    Civil
    Details
    Engineer
    Using
    AutoCAD 2017
    Join Date
    Jul 2016
    Location
    Netherlands
    Posts
    222

    Default

    Why dont you use the macromode variable?

  10. #10
    Forum Newbie
    Discipline
    Structural
    Using
    AutoCAD 2018
    Join Date
    Nov 2017
    Posts
    9

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by Roy_043 View Post
    @MahReda:
    What part of the dwgname do you want to remove?
    Note: You can directly reference the file name without the extension in a field.
    i want to show first 11 letter of the drawing name

    but unfortunately in some drawings i need to show only 10 or 9 letters

Similar Threads

  1. Returning last user variable
    By Andrew1979 in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 13th Jul 2015, 03:42 am
  2. MASK TXT or MTXT lsp=>VB ??? SETDATA/GETDATA/SELECTIONSET/MTXT
    By acad386bis in forum .NET, ObjectARX & VBA
    Replies: 0
    Last Post: 8th Jul 2014, 10:18 am
  3. Replies: 6
    Last Post: 19th Oct 2012, 02:55 am
  4. New autocad 3d user trying to make custom junction boxes
    By SublimeSilence in forum AutoCAD 3D Modelling & Rendering
    Replies: 8
    Last Post: 13th Dec 2010, 06:22 pm
  5. copy Mtxt into block
    By Ozymandias in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 3rd Feb 2010, 05:23 pm

Bookmarks

Posting Permissions

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