+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 24
  1. #1
    Junior Member
    Using
    Civil 3D 2015
    Join Date
    Nov 2014
    Posts
    18

    Default Deviation Autolisp command

    Registered forum members do not see this ad.

    Hello All,
    I am new to this forum. I am working on an autolisp command and i have hit the wall and need a bit of assistance, so thanks in advance for the help. A brief background on what it is im trying to do - I work for a construction company that installs concrete piles in the ground which then have to be surveyed and that information has to be checked against the location the engineer has setup in the construction drawings interms of movement in the x,y, & z axis. The command i am trying to write would do the math by clicking on the center of the green circle (the engineers proposed location) and then the center of the red circle (the location the pile was actually installed). It would then insert those variables into an mtext entity. The issue i am coming up with is "too many arguments" and i can't figure out where the extra argument is in the command.

    Those are the basics of what i want this command to do and here is what i ultimately want it to do (a wish list of sorts):

    1- have the command know whether the "zdev" is positive or negative and add either "high" or "low" to the "zdev" part of the mtext entity.
    2- have the center of the red circle be the insertion point
    3- have the arrows that you see in the .dwg file insert themselves based upon whether the "xdev" and "ydev" are positive or negative.

    If any one could point me in the right direction on any of these issues that would be awesome.

    Thanks again,
    John

    Deviation_INFO.dwgDeviations.lsp

  2. #2
    Super Member hmsilva's Avatar
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2016
    Join Date
    Dec 2012
    Location
    Cascais, Portugal
    Posts
    531

    Default

    Hi John, and welcomed to CADTutor!


    To comment an AUTO/Visuallisp code we must use a semicolon, and your code had some misplaced parenthesis...
    Attached is your code, revised, and my interpretation of your code.


    Hope that helps
    Henrique
    Attached Files
    Last edited by hmsilva; 7th Nov 2014 at 11:18 pm. Reason: Correction of an attached file

  3. #3
    Junior Member
    Using
    Civil 3D 2015
    Join Date
    Nov 2014
    Posts
    18

    Default

    Henrique,
    The revisions you mad to my LISP work great.
    I tried your version but after i select the first circle as prompted the command ended and i'm not sure why. (If you could explain some of the coding that would be great... I learn things like this better when i can see them at work.

    I would like to add a few more features to my LISP:
    1)Can the negative symbol in the elevation deviation be suppressed.?
    2)Can the "HIGH/LOW" be suppressed when the elevation deviation is zero when rounded to two decimal places "0.00"?
    3)Can the center of the red circle - variable "PT2" be set as the insertion point of the mtext entity? (the project i am working on requires me to run this LISP almost 800 times and it would be a big help the have the mtext insert itself.
    4)Can arrows be inserted as shown in the previously attached file so that they correlate to the direction in which the the red circle has moved in relation to the green circle. ie left=neg / right=positive / down=neg / up=positive.

    Any insight and direction into coding these features would be awesome!

    Thanks again,
    John

  4. #4
    Super Member hmsilva's Avatar
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2016
    Join Date
    Dec 2012
    Location
    Cascais, Portugal
    Posts
    531

    Default

    Hi John,
    my 'demo' should work as expected, the code was written according your 'Deviation_INFO.dwg' and hardcoded that dwg layers.

    The code prompts:

    Select the proposed location circle: << you should select a circle 'in' layer "off", color green >>
    Select the actual location circle: << you should select a circle 'in' layer "PILE DEVIATIONS", color red >>
    Enter pile number: << you should enter an integer >>

    If you don't select an object, or don't enter an integer, the code will exit...

    Try the code in your 'Deviation_INFO.dwg' and let me know if it works as expected ou not.

    Regarding your last requests, only tonight I'll be able to modify your code, I'm out of office, and without AutoCAD.


    Henrique

  5. #5
    Junior Member
    Using
    Civil 3D 2015
    Join Date
    Nov 2014
    Posts
    18

    Default

    Henrique,
    I just figured out the what was happening. Your LISP works amazing. The hiccup was in that the circles in the drawings "green were part of a block and red is a cogo point" Is the cogo point an entity that can be selected do to the fact that i get the information as a COGO point and i can assign that red circle (which is a block) as the point style. Also is it possible to keep the green circles as a block and still be able to select the necessary circle.(More for drawing neatness than anything else "having 800 circles floating around is silly to me"

    If you have an extra minute and would be willing to explain some of your coding that would be awesome.

    As always Thank You!

    John

  6. #6
    Junior Member
    Using
    Civil 3D 2015
    Join Date
    Nov 2014
    Posts
    18

    Default

    I just tried swapping "CIRCLE" for "COGO" that didn't work. Any ideas?

  7. #7
    Super Member hmsilva's Avatar
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2016
    Join Date
    Dec 2012
    Location
    Cascais, Portugal
    Posts
    531

    Default

    John,


    post a real sample dwg with some objects.


    Henrique

  8. #8
    Junior Member
    Using
    Civil 3D 2015
    Join Date
    Nov 2014
    Posts
    18

    Default

    Henrique,
    I have attached a .dwg with four COGO points and one block that has four green circles in it. A mini sample of what i'm doing.

    Thanks,
    John
    Attached Files

  9. #9
    Super Member hmsilva's Avatar
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2016
    Join Date
    Dec 2012
    Location
    Cascais, Portugal
    Posts
    531

    Default

    Ok john,
    tonight, I'll see what I can do.


    Henrique

  10. #10
    Super Member hmsilva's Avatar
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2016
    Join Date
    Dec 2012
    Location
    Cascais, Portugal
    Posts
    531

    Default

    Registered forum members do not see this ad.

    Demo_V1.LSP
    Quote Originally Posted by johnm1011 View Post
    1)Can the negative symbol in the elevation deviation be suppressed.?
    2)Can the &quot;HIGH/LOW&quot; be suppressed when the elevation deviation is zero when rounded to two decimal places &quot;0.00&quot;?
    3)Can the center of the red circle - variable &quot;PT2&quot; be set as the insertion point of the mtext entity? (the project i am working on requires me to run this LISP almost 800 times and it would be a big help the have the mtext insert itself.
    4)Can arrows be inserted as shown in the previously attached file so that they correlate to the direction in which the the red circle has moved in relation to the green circle. ie left=neg / right=positive / down=neg / up=positive.
    Quote Originally Posted by johnm1011 View Post
    If you have an extra minute and would be willing to explain some of your coding that would be awesome.
    John,

    the attached code was revised to work with the 'COGO pts and blocks.dwg', expects the green circles as a block.
    I did add some comments to the code.

    Hope that helps
    Henrique

Similar Threads

  1. AutoLISP Using FeatureElevsFromSurf COMMAND
    By srv560 in forum AutoCAD 3D Modelling & Rendering
    Replies: 2
    Last Post: 20th Jan 2015, 11:22 am
  2. Use burst command within autolisp.
    By Mbuk in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 8th Jan 2011, 06:07 pm
  3. Autolisp instead of View command
    By Tharwat in forum AutoLISP, Visual LISP & DCL
    Replies: 14
    Last Post: 18th Aug 2010, 03:41 pm
  4. Chordal Tolerance/Triangular Deviation
    By BSouders in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 7th Feb 2007, 05:08 pm
  5. AutoLISP: change last command
    By driutheman in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 2nd Dec 2005, 05:49 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