Here is what I need to do.....
createpointinterpolate
pick the 2 points
then automaticly enter
1 (for number of points)
30 (for offset)
PG (for description)
I can edit the lisp to change the offset and description as needed.
I have about 150 of these to do so I'm trying to automate it as much as possible.
I just can't figure out how to do this with my limited lisp hacking ability 😉
TIA
Robert
Solved! Go to Solution.
Solved by Jeff_M. Go to Solution.
Solved by Jeff_M. Go to Solution.
Here is a quickly penned solution that does this:
;;Add 1 interpolated CogoPoint between 2 points selected on screen. ;;Includes preset offset and description variables. ;;by Jeff Mishler, Jan. 26, 2014 (defun c:int1point (/ *acad* c3d c3ddoc desc dir doc midpt offset p1 p2 p3 point points prod prodstr ) (vl-load-com) (setq prod (vlax-product-key)) (setq prodStr (strcat "AeccXUiLand.AeccApplication" (cond ((vl-string-search "\\R17.0\\" prod) ".4.0" ) ;;2007 ((vl-string-search "\\R17.1\\" prod) ".5.0" ) ;;2008 ((vl-string-search "\\R17.2\\" prod) ".6.0" ) ;;2009 ((vl-string-search "\\R18.0\\" prod) ".7.0" ) ;;2010 ((vl-string-search "\\R18.1\\" prod) ".8.0" ) ;;2011 ((vl-string-search "\\R18.2\\" prod) ".9.0" ) ;;2012 ((vl-string-search "\\R19.0\\" prod) ".10.0" ) ;;2013 ((vl-string-search "\\R19.1\\" prod) ".10.3" ) ;;2014 (t "") ) ) ) (setq offset 30.0 desc "PG" ) (if (and (setq *acad* (vlax-get-acad-object)) (setq doc (vla-get-activedocument *acad*)) (setq C3D (vla-getinterfaceobject *acad* prodStr)) (setq C3Ddoc (vla-get-activedocument C3D)) (setq points (vlax-get c3ddoc 'points)) ) (progn (vla-startundomark doc) (while (and (setq p1 (getpoint "\nFirst point: ")) (setq p2 (getpoint p1 "....second point: ")) ) (setq midpt (mapcar '(lambda (a b) (/ (+ a b) 2.0) ) p1 p2 ) dir (angle p1 p2) ) (setq p3 (polar midpt (- dir (* pi 0.5)) offset)) (setq point (vlax-invoke points 'add p3)) ) (vlax-release-object C3D) ) ) (princ) )
Wow. Pretty close.
Needs to be able to use the elevation of the cogo point to interpolate the new elevation.
Set the the raw description value of the cogo point to be created to the value in desc.
This uses my description keys to set how the point looks.
Thanks!!!!!!
Robert
If you existing CogoPoint style(s) are ste to display at elevation this would work by snapping to the node. BTW, you didn't say between 2 cogopoints, so I had to assume you were picking 2 points on the screen (such as endpoints of lines, near to a featureline, etc.) so it uses the elevations of those picked points.
To add the description (yep, I forgot this part), add this line of code immediately after the (setq point .... ) line:
(vlax-put-property point 'rawdescription desc)
Now, if you want to select 2 cogopoints instead of 2 random points via osnap, that will be a bit more code.
Glad I could help! In caae you really want to just select 2 cogopoints, here's another version that does this:
(defun c:int1point_cgpoints (/ *acad* c3d c3ddoc desc dir doc midpt offset p1 p2 p3 point points prod prodstr ) (vl-load-com) (setq prod (vlax-product-key)) (setq prodStr (strcat "AeccXUiLand.AeccApplication" (cond ((vl-string-search "\\R17.0\\" prod) ".4.0" ) ;;2007 ((vl-string-search "\\R17.1\\" prod) ".5.0" ) ;;2008 ((vl-string-search "\\R17.2\\" prod) ".6.0" ) ;;2009 ((vl-string-search "\\R18.0\\" prod) ".7.0" ) ;;2010 ((vl-string-search "\\R18.1\\" prod) ".8.0" ) ;;2011 ((vl-string-search "\\R18.2\\" prod) ".9.0" ) ;;2012 ((vl-string-search "\\R19.0\\" prod) ".10.0" ) ;;2013 ((vl-string-search "\\R19.1\\" prod) ".10.3" ) ;;2014 (t "") ) ) ) (setq offset 30.0 desc "PG" ) (if (and (setq *acad* (vlax-get-acad-object)) (setq doc (vla-get-activedocument *acad*)) (setq C3D (vla-getinterfaceobject *acad* prodStr)) (setq C3Ddoc (vla-get-activedocument C3D)) (setq points (vlax-get c3ddoc 'points)) ) (progn (vla-startundomark doc) (while (and (princ "\nFirst point: ") (setq ss1 (ssget ":S" '((0 . "AECC_COGO_POINT")))) (princ "....second point: ") (setq ss2 (ssget ":S" '((0 . "AECC_COGO_POINT")))) ) (setq cg1 (vlax-ename->vla-object (ssname ss1 0)) cg2 (vlax-ename->vla-object (ssname ss2 0)) p1 (vlax-get cg1 'location) p2 (vlax-get cg2 'location) ) (setq midpt (mapcar '(lambda (a b) (/ (+ a b) 2.0) ) p1 p2 ) dir (angle p1 p2) ) (setq p3 (polar midpt (- dir (* pi 0.5)) offset)) (setq point (vlax-invoke points 'add p3)) (vlax-put-property point 'rawdescription desc) ) (vlax-release-object C3D) ) ) (princ) )
Jeff.. Your solution is so very close to a function I am trying to perform as well, I'd thought I'd ask if you have a suggestion for me. I am hoping to be able to select a start point (have it prompt me for an elevation) pick and end point (have it prompt me for an elevation) and then create interpolated point objects along that line. If it could ask me how many points (the way the interpolate command does), but also prompt me for offset values and point descriptions, that would be perfect.
Are there modifications to your existing code that would allow me to do this?
Thanks for your time and input! I really appreciate your expertise.
Have you tried create points>Interpolate>by relative location.
or
create points>Interpolate>by incremantal distance.
I use these all the time when I calc staking points.
Jeff's routine worked great for the grading plans I was working on when he wrote them for me.
It's easy to modify the offset and desc in the lisp.
That command is so close as well... the only issue is that I need to be able to snap to the location I want a graded point to appear, otherwise I will have to list all my distances in a seperate step before entering the command and creating points. I realize that I didn't mention that in the above. Thanks for the reply.
CreatePoints>Interpolate>Perpendicilar will let you pick where you
want the points. I'll create a polyline (can be a curvey one too) between
the 2 grade points.
So you could do this......
use the divide command to set nodes equally along a poly line or line
set your osnaps to node
CreatePoints>Interpolate>Perpendicilar
If you have your command line view set to 4 spaces (I have dynmode set to 0, I'm a little old school)
it will display the distances between the 2 points you picked in my last response, I have
a HP 48 emulator I use on screen or a HP 49 sitting on my desk. a quick divide and
you have your distance. I admit being able to just tell it 3 points would be great.
You know... I think I just had limited understanding of the way the existing interpolate commands worked. I didn't realise that instead of having to know and input a distance, I could actually select two end points (while it was prompting me to enter a known distance) and it would calculate the grade based on endpoints. It looks like I can do exactly what I need with the tools already provided... I just didn't understand them enough. I sat there and played with all of them for about 40 mins after reading your post.
Thanks for the help.
Interesting post.
I wonder if it´s possible to place a LISP routine in the Tool Palette that lets me place a CivilPoint with a certain description and elevation and so on?
Anyone that could give a "start-LISP" for me to understand how it´s done?
I want to have a Tool Palette with traffic signs made from Civil COGO point. I want to have one point type for stop signs, another one for cycle ways and so on.
But I don´t know where to start. I can place a point command in Tool Palette but then C3D asks for description and that part I want to describe in the LISP routine.
Easiest way is to create a description key for what you want.
Ie.....
To create a Masked Circle with a number in it i have a description key set up with "SN $1"
I input SN 1 and I get a masked circle with the number 1 in it.
So if you want a stop sign simply create a key for it.
HTH
Bo