bubsta82 Posted July 26, 2011 Share Posted July 26, 2011 (edited) I need help converting a X value and a Y value to a usable point for this function (if (not c:cal)(arxload "geomcal")) (setq x (cal "ang(xy,xy2,xy1)")) Which finds the angle between two points. Here is what I have tried. (setq xy (list xval yval)) I modified an existing code to export the coordinates of a polyline to a .txt file in seperate x and y values. Which works, but when I try to add the angle between them by recombining the x and y values and getting this error. Value of AutoLISP variable XY must be a point, real or integer So I am guessing using the list is not working! full2.Lsp Edited July 26, 2011 by rkmcswain added CODE tags Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 27, 2011 Share Posted July 27, 2011 maybe something like this (setq ptxyz (list (atof easting)(atof northing) (atof height))) (command "point" ptxyz) Quote Link to comment Share on other sites More sharing options...
irneb Posted July 27, 2011 Share Posted July 27, 2011 Your problem appears to be due to you using rtos and then using that string on the cal function. I'd actually go with something like this: ;start the loop (repeat (/ (length thelist) 2) (setq xval (rtos (setq x (nth n thelist))) n (1+ n) yval (rtos (setq x (nth n thelist))) xy (list x y) n (1+ n) xf (cal "ang(xy,xy2,xy1)") ) ... Note also you don't need to arxload the geomcal each time you use it. You can move that to outside the defun even, or at least outside the repeat loop. Quote Link to comment Share on other sites More sharing options...
bubsta82 Posted July 27, 2011 Author Share Posted July 27, 2011 Thank Both of you so much I'll give both of those a try ! Quote Link to comment Share on other sites More sharing options...
bubsta82 Posted July 29, 2011 Author Share Posted July 29, 2011 Update! Finished the routine to do exactly what I needed! Thank you irneb for your input! it was exactly what I needed with slight modification to access a previous point and a next point. The routine allows you to select a polyline, checks to see if it is indeed a polyline, then prompts for for a file output if needed. If so, prompts for a file name and will save the point number of all vertex with the x and y coordinate, latitude and longitude and the change in angle at each vertex. As an added bonus there is a prompt to label the vertex number, Northing and Easting, and angle on the drawing if needed. Does a great job at placing the text at different points along the line to avoid confusion. They then can be moved. If there is any interest in the .lsp file let me know! Quote Link to comment Share on other sites More sharing options...
symoin Posted August 8, 2017 Share Posted August 8, 2017 Please post your updated code Thanks 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.