See the top rated post in this thread. Click here

Results 1 to 10 of 10

Thread: lisp help to move then offset

  1. #1
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Default lisp help to move then offset

    Hi everyone,

    I'm looking to get help getting this program to work. I'm looking for it to move an object by selecting the endpoint, then the endpoint of the destination point, and finally offsetting it by a given distance.

    Here is my code so far.
    Code:
    (DEFUN C:ME1/2()(SETVAR "CMDECHO" 0)(setq sset (ssget))(COMMAND "._MOVE" sset "" "ENDPOINT" PAUSE "ENDPOINT")(COMMAND "offset" "0.50")(SETVAR "CMDECHO" 1)(princ))
    Thanks,

    Cadd4la

  2. #2
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    1

    Default Re: lisp help to move then offset

    I've been messing around with this to no avail, but it did bring up questions.

    When you say "move an object" are you talking about a line, or many objects, and/or a block?
    Because the SSGET allows multiple object picks, but when you want to "offset" you can't do that to objects other than a line (using the "offset" command).

    So the "ssget" and "move" part of your routine works, but the "offset" doesn't, perhaps you need to change that to "move" with some math/coordinates?

    Hopefully someone out there can help.

  3. #3
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Default Re: lisp help to move then offset

    Tedg,

    Thanks for your help. I mainly want it to use on blocks.

    Regards,

  4. #4
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,105
    Login to Give a bone
    1

    Default Re: lisp help to move then offset

    Quote Originally Posted by cadd4la View Post
    Tedg,

    Thanks for your help. I mainly want it to use on blocks.

    Regards,
    How do you offset a block?
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  5. #5
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Default Re: lisp help to move then offset

    Opie,

    I just use the offset command.

    Also, I want it to use on objects like viewports

    Cadd4la

  6. #6
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: lisp help to move then offset

    Example for using ssget to behave like an AutoCAD command for selecting a single object.
    Code:
    (setq ss (ssget "+.:E:S" '((0 . "lwpolyline,spline,circle,ellipse"))))
    ; :E  Everything in aperture
    ; :S  Force single object selection only
    ; The "+." puts (ssget) into "point" mode. It helps the ":S"
    ; single-mode act just like (entsel) by avoiding implied
    ; selection windows.
    Lee Mac's tutorial on ssget function format: http://www.lee-mac.com/ssget.html

  7. #7
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Default Re: lisp help to move then offset

    Quote Originally Posted by Tom Beauford View Post
    Example for using ssget to behave like an AutoCAD command for selecting a single object.
    Code:
    (setq ss (ssget "+.:E:S" '((0 . "lwpolyline,spline,circle,ellipse"))))
    ; :E  Everything in aperture
    ; :S  Force single object selection only
    ; The "+." puts (ssget) into "point" mode. It helps the ":S"
    ; single-mode act just like (entsel) by avoiding implied
    ; selection windows.
    Lee Mac's tutorial on ssget function format: http://www.lee-mac.com/ssget.html
    Tom,

    Thanks for your input but my lisp skills are basic, I'm looking for someone to fix or rewrite from scratch the code so it will do want I need.

    Regards,

  8. #8
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: lisp help to move then offset

    Quote Originally Posted by cadd4la View Post
    Tom,

    Thanks for your input but my lisp skills are basic, I'm looking for someone to fix or rewrite from scratch the code so it will do want I need.

    Regards,
    Here's a slight modification with variables localized to avoid conflicts with other lisp:
    Code:
    (DEFUN C:ME1/2 (/ sset CMDECHO)
    	(SETVAR "CMDECHO" 0)
    	(setq sset (ssget "+.:E:S")
    	      CMDECHO (GETVAR "CMDECHO"))
    	)
    	(COMMAND "._MOVE" sset "" "ENDPOINT" PAUSE "ENDPOINT")
    	(COMMAND "offset" "0.50")
    	(princ)
    )
    More recent versions need to use COMMAND-S now.

  9. #9
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Default Re: lisp help to move then offset

    Tom,

    Thank you for your help unfortunately the code is not working for.

    I'm getting this when I load the code
    Command: (LOAD "C:/Verde/04-CADCustomFiles/ME1_2.LSP") ._MOVE
    Select objects:
    Command: U
    Command: ENDPOINT Unknown command "ENDPOINT". Press F1 for help.
    Cadd4la

  10. #10
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: lisp help to move then offset

    Quote Originally Posted by cadd4la View Post
    Tom,

    Thank you for your help unfortunately the code is not working for.

    I'm getting this when I load the code


    Cadd4la
    I simply added local variables and modified the ssget portion of your code.
    Replacing each "ENDPOINT" with "endp" should get you through the move portion of your code at least.

    Like Opie I know now way to offset a block or viewport though.

    If you explain what you're trying to accomplish instead of steps (that will not work) you will get more helpful replies.

Similar Threads

  1. Replies: 0
    Last Post: 2016-10-28, 05:44 PM
  2. 2014: Rendering does not start, then rendering dialog disappears, then 3D view turns black
    By gabsimonelouise692565 in forum Revit - Rendering
    Replies: 2
    Last Post: 2015-06-02, 07:34 PM
  3. If-Then Lisp Help Please
    By Al Moroz in forum AutoLISP
    Replies: 18
    Last Post: 2010-03-31, 01:12 AM
  4. Need Help With An 'If - Then' Lisp
    By Al Moroz in forum AutoLISP
    Replies: 2
    Last Post: 2008-07-22, 10:28 PM
  5. Non-ordinary walls then philosophy then tablets/flatscreens
    By aghis in forum Revit Architecture - General
    Replies: 57
    Last Post: 2003-07-19, 05:23 PM

Tags for this Thread

Posting Permissions

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