Trudy Posted December 16, 2020 Posted December 16, 2020 Hello everyone, sorry if my question is stupid but i dont understands how it work. I want to ask after "(vlax-dump-object obj T)" and find all methods. ; Methods supported: ; AddPointMultiple (1) ; ArrayPolar (3) ; ArrayRectangular (6) ; Copy () ; CreateSnapshot () ; Delete () ; ExtractBorder (1) ; ExtractContour (4) ; FindElevationAtXY (2) ; GetBoundingBox (2) .................................... others. In my case i dump Tin surface. Question is how can i use them, i found for this (setq contours (vlax-invoke-method obj 'FindElevationAtXY X Y)) (setq something (vlax-invoke-method obj 'ExtractContour ? ? ? ?)) if i understand right i need 4 parameters but dont know where to find them. Where or how i can see for each method what is the parameter. My goal is to extract grid lines from surfaces. Thank you Quote
Jonathan Handojo Posted December 16, 2020 Posted December 16, 2020 It's normally located under this link of your own PC: "C:\Program Files\Common Files\Autodesk Shared" Look for the file "acadauto.chm". You'll find all the methods and the parameters each one takes. 1 1 Quote
BIGAL Posted December 17, 2020 Posted December 17, 2020 (edited) Well you learn something new every day Google 'ExtractContour CIV3D help Not sure why when you can use the aecexporttoautocad command, trying to remember the exact wording need to go in and look it up used it before more options than just contours. depends on what is displayed. Grid lines there is a grid option in Civ3d now where is it I think in the add points to surface options look in ribbon. Hmmmm Google "grid CIV3D help" Need togo exploring again. Edited December 17, 2020 by BIGAL 1 Quote
Trudy Posted December 17, 2020 Author Posted December 17, 2020 Hello BIGAL i want to create something with dcl and i need the grid when i can create in surface. And from that i know its not very good to use command in dcl. And for that reason i search for other way to create the grid in surface boundaries. Quote
BIGAL Posted December 18, 2020 Posted December 18, 2020 When you say grid lines to clarify are you saying sections or XYZ of a grid point, 10,10 10,20 etc Making a list of grid points is straight forward. Then use the 'FindElevationAtXY ; pick a surface must be able to see it (setq obj (vlax-ename->vla-object (car (entsel "Pick obj")))) (setq pt (vlax-invoke-method obj 'FindElevationAtXY 268720.297 5781240.625)) 16.375 Quote
Trudy Posted December 18, 2020 Author Posted December 18, 2020 Hi BIGAL i want to create something similar i need the grid sections and i think i can extract intersect points after that i have to make all of the grid like polygons and after that at intersect point i will extract elevation. Problem for now is the Grid in surface. And after all of the stuff i want to create one DCL for everything. Thank you for help Quote
BIGAL Posted December 19, 2020 Posted December 19, 2020 I am totally confused if you want sections every 10 then thats what cross sections are for, can do X sections and Y sections by using two alignments. Quote
Trudy Posted December 19, 2020 Author Posted December 19, 2020 Hello BIGAL i found solution for grid lines now i have to make polygon for each box Quote
hosneyalaa Posted December 20, 2020 Posted December 20, 2020 On 12/17/2020 at 1:11 AM, Trudy said: Hello everyone, sorry if my question is stupid but i dont understands how it work. I want to ask after "(vlax-dump-object obj T)" and find all methods. ; Methods supported: ; AddPointMultiple (1) ; ArrayPolar (3) ; ArrayRectangular (6) ; Copy () ; CreateSnapshot () ; Delete () ; ExtractBorder (1) ; ExtractContour (4) ; FindElevationAtXY (2) ; GetBoundingBox (2) .................................... others. In my case i dump Tin surface. Question is how can i use them, i found for this (setq contours (vlax-invoke-method obj 'FindElevationAtXY X Y)) (setq something (vlax-invoke-method obj 'ExtractContour ? ? ? ?)) if i understand right i need 4 parameters but dont know where to find them. Where or how i can see for each method what is the parameter. My goal is to extract grid lines from surfaces. Thank you http://docs.autodesk.com/CIV3D/2012/ENU/API_Reference_Guide/com/AeccXLandLib__IAeccSurface__ExtractContour@[in]_AeccDisplayOrientation@[in]_AeccSurfaceFilterType@[in]_double@[in]_double@[out,_retval]_VARIANT_.htm (defun c:ExtractContour_MIN_MAX (/ c3d c3ddoc surfs *acad* surf contours) (vl-load-com) (if (and (setq ss (ssget ":S" '((0 . "AECC_*_SURFACE")))) (setq surf (vlax-ename->vla-object (ssname ss 0))) (setq surstatistics(vlax-get surf 'statistics)) ;(setq low (getreal "\nMinimum Elevation: ")) (setq low (vlax-get surstatistics 'minelevation)) ;(setq high (getreal "...Maximum Elevation: ")) (setq high (vlax-get surstatistics 'MAXelevation)) (setq *acad* (vlax-get-acad-object) 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) ) ) ) (progn (setq c3ddoc (vlax-get c3d 'activedocument) surfs (vlax-get c3ddoc 'surfaces) ) (setq surf (vlax-ename->vla-object (ssname ss 0))) (setq contoursm (vlax-invoke surf 'ExtractContour 1 4 low high)) (setq contoursn (vlax-invoke surf 'ExtractContour 1 5 low high)) (if (not (vlax-object-released-p c3d)) (vlax-release-object c3d) ) (if (not (vlax-object-released-p *acad*)) (vlax-release-object *acad*) ) ) ;;(progn ) ;; (if (princ) ) Quote
BIGAL Posted December 20, 2020 Posted December 20, 2020 (edited) For Trudy If you can make the grid then you can make two lists the horizontal lines and the vertical lines and get the intersection points and end points then get Z. Having done something with grids recently my attack would be to pick lower left and upper right point, you do a rounding down but not decimal place but down to the grid even values eg 123.45,678.9 =120,670 for 10m grid spacing once you have this you can make a list using double repeat to make all points required you can also add the intersecting boundary points if required. Running (setq pt (vlax-invoke-method obj 'FindElevationAtXY 120 670)) will return a Z or not. Tested gives (setq ptxyz (vlax-invoke-method obj 'FindElevationAtXY (car pt) (cadr pt))) ; error: Automation Error. Point outside surface or 17.293 Need some help as it does a automation error need to trap and continue to next point, not just exit may need something that looks at error message for say "Automation" have something but running out of time other stuff starting to back up. I think the getpoint is a defun so error restarts defun again. An example of rounding down to 10 (setq cenx 123.45 ah:spc 10) (cond ((> 100.0 ah:spc)(setq lstr 2)) ((> 1000.0 ah:spc)(setq lstr 3)) ) (setq newcenx (rtos cenx 2 0)) (setq newcenintx (substr newcenx 1 (- (strlen newcenx) lstr))) (setq numrem (fix (/ (atof (substr newcenx (- (strlen newcenx)(- lstr 1)))) ah:spc))) (if (= numrem 0) (setq newcenintx (atof (strcat newcenintx "00"))) (setq newcenintx (atof (strcat newcenintx (rtos (* numrem ah:spc) 2 0)))) ) Edited December 20, 2020 by BIGAL Quote
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.