+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 25
  1. #1
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Aug 2012
    Posts
    14

    Default Offset a line without input from user(prompting)

    Registered forum members do not see this ad.

    Hi All,
    I am new to this forum and lisp.
    Trying to create cross sections of drain using lisp.The details of are fed from excel for each cross section.I am stuck as I was not able to figure out the way to offset line/polyline by selecting the lines and offset distance from the program itself.
    Any help would be appreciated.

    Thanks in advance.

    Cross SectionOf EWE H-100ch 0 to 575m.dwg
    read_excel_data_to_array.lsp
    drain.xls

    I have grabbed the code given by Fixo to read data from excel (http://www.cadtutor.net/forum/showthread.php?41910-Read-Excel-Data-Cells-and-Draw-in-AutoCAD-thru-LISP/page2). Thanks Fixo.

  2. #2
    Forum Deity Dadgad's Avatar
    Using
    AutoCAD 2012
    Join Date
    Nov 2011
    Location
    At the confluence of worthlessness & invaluability
    Posts
    3,133

    Default

    In order to start a lisp you need to enter the shortcall for the lisp, which will likely be at least two letters, that is assuming that it is already loaded.
    In order to start the OFFSET command you enter the letter O.
    How many key strokes are you hoping to save?
    Volume and repetition do not validate opinions forged in the absence of thought.

  3. #3
    Super Member Organic's Avatar
    Discipline
    Civil
    Using
    Civil 3D 2013
    Join Date
    Feb 2009
    Posts
    1,641

    Default

    Was the original post deleted?

  4. #4
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Aug 2012
    Posts
    14

    Default

    Quote Originally Posted by Dadgad View Post
    In order to start a lisp you need to enter the shortcall for the lisp, which will likely be at least two letters, that is assuming that it is already loaded.
    In order to start the OFFSET command you enter the letter O.
    How many key strokes are you hoping to save?
    Dadgad,
    What do u mean by strokes.(Sorry I am a newbee in lisp)
    I have already created polyline using lisps i need to offset the same polyline using same program.

  5. #5
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro 4000, 2GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2013
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    33,044

    Default

    Maybe a look at a lisp program Lee Mac wrote, called Double Offset, holds some clues about how to do what you want.

    http://lee-mac.com/doubleoffset.html
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

  6. #6
    Forum Deity Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draftsman
    Discipline
    Mechanical
    Using
    AutoCAD 2014
    Join Date
    Oct 2009
    Location
    Lives in Abu Dhabi
    Posts
    2,626

    Default

    Quote Originally Posted by avinashg View Post
    I have already created polyline using lisps i need to offset the same polyline using same program.
    Check this out , and you can change the minus to plus to play with the two sides

    Code:
    (defun c:Test (/ d side s i)
      (vl-load-com)
      (setq d 1.0)
      (if (setq s (ssget "_:L" '((0 . "LINE"))))
        (repeat (setq i (sslength s))
          (vla-offset (vlax-ename->vla-object (ssname s (setq i (1- i)))) (- d))
          )
        )
      (princ)
      )
    - When aim is being settled in my mind , I have to reach it and get it in hand whatever it costs and wherever it is and will never give up . Tharwat said

  7. #7
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Aug 2012
    Posts
    14

    Default Re

    Quote Originally Posted by Dink87522 View Post
    Was the original post deleted?
    Am not sure something might have happened anyhow m re posting it.

    Hi all,
    I am trying to create cross sections of drain using lisp data fed from excel.(Used the code posted by fixo in some thread) and drawing polylines and lines.
    I am struck as I am not able to figure out how to offset a line/polyline without prompting for selecting line and offset distance.
    Here are the files


    If anyone (with little free time) can help me by creating the program will be very gratefull.
    Attached Files

  8. #8
    Forum Deity Dadgad's Avatar
    Using
    AutoCAD 2012
    Join Date
    Nov 2011
    Location
    At the confluence of worthlessness & invaluability
    Posts
    3,133

    Default

    Welcome to the forum.
    Your first post was not a post, just the thread title, with no additional information.
    Now I understand that you are looking to add an OFFSET command into an existing lisp.
    Sorry I am lisp-challenged myself, but it doesn't sound too difficult, Iam sure
    somebody will straighten you out.

    By key strokes, I mean each time you enter a character on your keyboard.
    Volume and repetition do not validate opinions forged in the absence of thought.

  9. #9
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Aug 2012
    Posts
    14

    Default

    Quote Originally Posted by ReMark View Post
    Maybe a look at a lisp program Lee Mac wrote, called Double Offset, holds some clues about how to do what you want.

    http://lee-mac.com/doubleoffset.html
    Will check it out.Thanks

    Quote Originally Posted by Tharwat View Post
    Check this out , and you can change the minus to plus to play with the two sides
    Thanks Tharwat will try this one.

  10. #10
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Aug 2012
    Posts
    14

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by Tharwat View Post
    Check this out , and you can change the minus to plus to play with the two sides

    Code:
    (defun c:Test (/ d side s i)
      (vl-load-com)
      (setq d 1.0)
      (if (setq s (ssget "_:L" '((0 . "LINE"))))
        (repeat (setq i (sslength s))
          (vla-offset (vlax-ename->vla-object (ssname s (setq i (1- i)))) (- d))
          )
        )
      (princ)
      )

    Tharwat,
    This program even though creates offset will prompt to select line.

    Code:
    (ssget "_:L" '((0 . "LINE")))

Similar Threads

  1. Replies: 5
    Last Post: 20th Dec 2011, 09:53 am
  2. Looking for user input
    By Skilbride in forum AutoCAD General
    Replies: 13
    Last Post: 23rd May 2011, 08:28 pm
  3. Block Not Prompting for Attribute Input
    By ksperopoulos in forum AutoCAD General
    Replies: 2
    Last Post: 14th Feb 2009, 10:49 pm
  4. LISP line to remember last user input
    By brawleyman in forum AutoLISP, Visual LISP & DCL
    Replies: 9
    Last Post: 6th Jan 2009, 11:33 am
  5. Prompting a user for key info....
    By spanky in forum AutoCAD General
    Replies: 4
    Last Post: 17th Sep 2003, 08:51 am

Tags for this Thread

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