the attached file work perfectly in civil 3d 2012 but in civil 3d 2015 it does not work at all
i was wondering if someone on here could modify it to work in civil 3d 2015
thanks in advance
Allen
Solved! Go to Solution.
Solved by tyronebk. Go to Solution.
Unless I am really overlooking something, there is no reason for this LSP to be version dependent. The properties for the selected cogo points can be called with vlax-get without fetching the Civil 3D document.
I rewrote it to remove the version dependence, plus a bit of other clean up and error checking. Attached.
@tyronebk wrote:
Unless I am really overlooking something, there is no reason for this LSP to be version dependent. The properties for the selected cogo points can be called with vlax-get without fetching the Civil 3D document.
I rewrote it to remove the version dependence, plus a bit of other clean up and error checking. Attached.
Nope, you're right. I didn't even really look at the lisp, other than to see what the version was, change it, and comment out the call to the geomcal.arx. I saw it could be cleaned up quite a bit, but had no time to do so myself. Thanks for doing so!
AWESOME THANKS A LOT
I got back to what Jason said: Use the Inquiry Tool. It is a floating tool that you can keep open (rolled up if you want) and use it to make the point inverses. It give more information and remembers the points so that you may only need to pick one point.
Regards,
Peter Funk
Autodesk, Inc.
The inquiry tools are useful and powerful, but not necessarily a replacement for a simple script like this. Their biggest drawback is the amount of time required to get to the information you are after. Allen's routine takes maybe two seconds to get a result (si, enter, pick pick), whereas the inquiry palette can take more than 10 seconds [analyze tab, inquiry tools, switch combobox to point inverse, click point 1, pick, click pt 2, pick]. If you are doing many points in a row though, the inquiry tools may make more sense.
I've personally written inquiry commands that I know already exist in the inquiry tools simply because the inquiry tools take too long to use. If there were commandline versions of these commands they would be much handier. Even aliases to bring up the different inquiry types would be helpful.
There are other things that slow me down when using the inquiry tools too, but are less of a concern. E.g. having to pick the profile or section view you want to work in when it is trivial to figure this out for the user; if there is any confusion about which view is being worked in, then prompt the user.
I was suggesting that you don't close it so that you have a floating Inquiry Tool up all the time. I do have multiple monitors so I park it, but you could also use the "Auto-hide" or roll-up feature on the tool. It will stay on Point Inverse until you close Civil 3D, and the next time you'll only need to change the type. With the dialog floating you just pick the two points and get the inverse.
I understand the value of the quick LISP command. If you can remember command it is a great solution.
Peter Funk
Autodesk, Inc.
i was wondering if you could help me with another lisp reoutine to work in 2015 civil 3d
it is attached
@Anonymous wrote:
is there a way to not make it version dependant
Yes, I leave it to you to figure out how to implement this, that way you can update it yourself in the future.
(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 ((vl-string-search "\\R20.0\\" prod) ".10.4" ) ;;2015 (t "") ) ) ) (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)) )
There is no guarantee that this will work for all past or all future versions of Civil 3D, but it works for all the versions of C3D I have available for testing (2011 -> 2015).
Replace the line:
(setq C3D (vla-getinterfaceobject *acad* "AeccXUiLand.AeccApplication.9.0"))
With:
(setq C3D (strcat "HKEY_LOCAL_MACHINE\\" (if vlax-user-product-key (vlax-user-product-key) (vlax-product-key) ) )
C3D (vl-registry-read C3D "Release")
C3D (substr C3D 1 (vl-string-search "." C3D (+ (vl-string-search "." C3D) 1) ) )
C3D (vla-getinterfaceobject *acad* (strcat "AeccXUiLand.AeccApplication." C3D) ) )
This should fill in the proper release number for the version of Civil 3D it is run in.
Hi Tyronebk,
Not sure if you can help but i have now installed 2016 and saw your post about lisp dependant on what version of civil you are using. Any chance you can look at this one that scales but leaves the "z" value? Very handy in surveying .
No worries if not.
Thanks
Allan
(vl-load-com) (defun c:go() (getdoc) ;select points to scale (prompt "\nSelect points to scale: ") (setq ss (ssget)) (setq len (sslength ss) ctr 0) ;get basepoint (setq p1 (getpoint "\nPick BasePoint: ")) (setq sc (getreal "\nEnter Scale Factor: ")) (while (< ctr len) (setq curpt (ssname ss ctr)) (setq obtyp (cdr (assoc 0 (entget curpt)))) (if (= obtyp "AECC_COGO_POINT") (progn (setq vpt (vlax-ename->vla-object curpt)) (setq curz (vlax-get-property vpt 'Elevation)) (vl-cmdf "Scale" curpt "" p1 sc) (vlax-put-property vpt 'Elevation curz) );end progn );end if (setq ctr (1+ ctr)) );end while (vl-cmdf "REGEN") (princ) ) ;end GO (defun getdoc () (setq prod (vlax-product-key)) (setq aecappno (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 ((vl-string-search "\\R20.0\\" prod) ".10.4" ) ;;2016 ((vl-string-search "\\R21.1\\" prod) ".10.5" ) ) ) ) (setq acadapp (vlax-get-acad-object) c3dapp (vla-getinterfaceobject acadapp aecappno) C3Ddoc (vla-get-activedocument C3Dapp) ) )