johnm1011 Posted November 7, 2014 Share Posted November 7, 2014 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 Deviations.lsp Deviation_INFO.dwg Quote Link to comment Share on other sites More sharing options...
hmsilva Posted November 7, 2014 Share Posted November 7, 2014 (edited) 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 Deviation.LSP Demo_.LSP Edited November 7, 2014 by hmsilva Correction of an attached file Quote Link to comment Share on other sites More sharing options...
johnm1011 Posted November 18, 2014 Author Share Posted November 18, 2014 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 Quote Link to comment Share on other sites More sharing options...
hmsilva Posted November 18, 2014 Share Posted November 18, 2014 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: > Select the actual location circle: > Enter pile number: > 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 Quote Link to comment Share on other sites More sharing options...
johnm1011 Posted November 18, 2014 Author Share Posted November 18, 2014 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 Quote Link to comment Share on other sites More sharing options...
johnm1011 Posted November 18, 2014 Author Share Posted November 18, 2014 I just tried swapping "CIRCLE" for "COGO" that didn't work. Any ideas? Quote Link to comment Share on other sites More sharing options...
hmsilva Posted November 18, 2014 Share Posted November 18, 2014 John, post a real sample dwg with some objects. Henrique Quote Link to comment Share on other sites More sharing options...
johnm1011 Posted November 18, 2014 Author Share Posted November 18, 2014 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 COGO pts and blocks.dwg Quote Link to comment Share on other sites More sharing options...
hmsilva Posted November 18, 2014 Share Posted November 18, 2014 Ok john, tonight, I'll see what I can do. Henrique Quote Link to comment Share on other sites More sharing options...
hmsilva Posted November 18, 2014 Share Posted November 18, 2014 Demo_V1.LSP 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. 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 Quote Link to comment Share on other sites More sharing options...
johnm1011 Posted November 19, 2014 Author Share Posted November 19, 2014 Henrique, LISP works awesome. The only thing that is off is the order of the selection i need to be able to select the green circle "block" first then the red COGO point. I tried to rearrange myself but is was getting a "bad argument error message. Please help one more time! Thanks John Quote Link to comment Share on other sites More sharing options...
hmsilva Posted November 19, 2014 Share Posted November 19, 2014 The only thing that is off is the order of the selection i need to be able to select the green circle "block" first then the red COGO point. I tried to rearrange myself but is was getting a "bad argument error message. You're welcome, John. Done... Henrique Demo_V2.LSP Quote Link to comment Share on other sites More sharing options...
johnm1011 Posted November 19, 2014 Author Share Posted November 19, 2014 Henrique, Its perfect. Thank you, this will seriously shorten the time and more importantly the monotony of this part of my work. John Quote Link to comment Share on other sites More sharing options...
hmsilva Posted November 19, 2014 Share Posted November 19, 2014 You're welcome, John Glad I could help Henrique Quote Link to comment Share on other sites More sharing options...
johnm1011 Posted November 19, 2014 Author Share Posted November 19, 2014 Henrique, Ran into a snag. I'm using civil 3d which reads the red circles as they are intended "cogo points" and it wont let me select the cogo point and kicks me out of the command. It worked flawlessly on my home computer with regular autocad. How can i solve this? can cogo opints be converted to acad proxy entities (not sure what they are)? Quote Link to comment Share on other sites More sharing options...
hmsilva Posted November 19, 2014 Share Posted November 19, 2014 Henrique,Ran into a snag. I'm using civil 3d which reads the red circles as they are intended "cogo points" and it wont let me select the cogo point and kicks me out of the command. It worked flawlessly on my home computer with regular autocad. How can i solve this? can cogo opints be converted to acad proxy entities (not sure what they are)? John, unfortunately I'm not a C3D guy... Hopefully someone with C3D can step in and assist. Henrique Quote Link to comment Share on other sites More sharing options...
hmsilva Posted November 19, 2014 Share Posted November 19, 2014 (edited) John, although not a C3D C3D guy, let's see if I can do something functional... Copy /paste at command line (dumpallproperties (car (entsel))) select one of the cogo points, press F2 select the returned text, copy, open notepad paste the text, saveas .txt file and attach it... Henrique Edited November 19, 2014 by hmsilva Quote Link to comment Share on other sites More sharing options...
johnm1011 Posted November 19, 2014 Author Share Posted November 19, 2014 Henrique, Attached is the requested txt file. I hope this helps! John COGO point info.txt Quote Link to comment Share on other sites More sharing options...
hmsilva Posted November 19, 2014 Share Posted November 19, 2014 John, unfortunately dont helps... Try with (vlax-dump-object (vlax-ename->vla-object (car (entsel))) T) And subst. the previous .txt Henrique Quote Link to comment Share on other sites More sharing options...
johnm1011 Posted November 19, 2014 Author Share Posted November 19, 2014 Attached is the requested txt file. COGO point info 2.txt Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.