Paraglide1 Posted March 5, 2014 Posted March 5, 2014 Hello all, I want to get the boundary points for an IAeccTinSurface object. I can drill down to the boundaries object of the surface but I don't know where or how to get from there to the boundary points. Can anyone help with this? Here is what I've done so far: (SETQ this-ename (CAR (NENTSEL "\nSelect Surface (IAeccTinSurface Object): " ) ;_ end of ENTSEL ) ;_ end of CAR ) ;_ end of SETQ (SETQ this-object (VLAX-ENAME->VLA-OBJECT this-ename)) (vlax-dump-object (VLAX-GET this-object 'Boundaries)) ; IAeccSurfaceBoundaries: AeccSurfaceBoundaries interface ; Property values: ; Count (RO) = 0 T Quote
BIGAL Posted March 6, 2014 Posted March 6, 2014 Maybe modify this not tested ; get text with closed pline example (defun getcoords (ent) ; ent is a entsel pline (vlax-safearray->list (vlax-variant-value (vlax-get-property (vlax-ename->vla-object ent) ) "Coordinates" ) ) ) ) Try (vlax-safearray->list (vlax-variant-value (vla-get-property (VLAX-GET this-object 'Boundaries) 'coordinates) ) ) Quote
Paraglide1 Posted March 6, 2014 Author Posted March 6, 2014 Thanks BIGAL, I tried your code and it returned "error: ActiveX Server returned the error: unknown name: COORDINATES". A dump of the Boundaries object shows the following properties and methods: (vlax-dump-object (VLAX-GET this-object 'Boundaries) T) ; IAeccSurfaceBoundaries: AeccSurfaceBoundaries interface ; Property values: ; Count (RO) = 0 ; Methods supported: ; Add (5) ; Item (1) ; Remove (2) I have very little experience using Visual Lisp to access the Object Model (and none with .NET) so I am unsure if this is a complete listing. From my limited knowledge it seems that I need to do something with the Item method but I have no clue what that might be or even if that is correct. All of my attempts generate various errors and I don't understand enough to know whether I'm on the right track or not. Is there any published resource that describes how to use Visual Lisp to get at the various Object Model components? I find that most documentation is for .NET or obsolete VBA code. Quote
Paraglide1 Posted March 6, 2014 Author Posted March 6, 2014 Perhaps there are no "boundaries" and what I think is a "boundary" isn't? After all, the Count property is 0. (vlax-dump-object this-boundaries T) ; IAeccSurfaceBoundaries: AeccSurfaceBoundaries interface ; Property values: ; Count (RO) = 0 ; Methods supported: ; Add (5) ; Item (1) ; Remove (2) If this is the case what object(s) am I really looking for instead of AeccSurfaceBoundaries? There is what I think is a surface boundary which can be displayed or not displayed in my drawing. Quote
Hippe013 Posted March 6, 2014 Posted March 6, 2014 I believe you are looking to extract the outer border of the surface. Also know as an outer boundary. The added boundaries are different than the outer boundary that is in all tin surfaces created. To extract that boundary see the following code: (setq surfaceobject (vlax-ename->vla-object (car (entsel "\nSelect Surface Object:")))) (setq border (vlax-invoke-method surfaceobject 'ExtractBorder 1)) After invoking this you will see the border extracted. The above "border" symbol is a variant containing the safearray that contains the 3dpolyline that was created. I hope that this helps. regards, hippe013 Quote
BIGAL Posted March 6, 2014 Posted March 6, 2014 Nice one hippe013 this link shows how to get at multiple surfaces via a dcl rather than using a entsel this may be usefull if this method was expanded to multiple surfaces http://www.cadtutor.net/forum/showthread.php?49417-Changing-CIV3d-contours-simply&highlight=contours A second question finding out about objects in the Aecc model is very hard where did you find out about 'extractborder ? There were a lot of examples for Civ3d in 2011 re coding but these are not on the dvd in 2013 next time we fire up an old machine I will pull them off and copy them to somewhere safe. Quote
Hippe013 Posted March 6, 2014 Posted March 6, 2014 A second question finding out about objects in the Aecc model is very hard where did you find out about 'extractborder ? BIGAL, I have been finding that it is becoming more and more difficult to find VLISP documentation for Aecc Objects. My first step is to do a vlax-dump-object on the vla-object. What becomes difficult is when the methods require arguments. I typically end up looking to the .NET documentation for argument information. Though this can end up being a guessing game as in the case for the extractborder method. The extractborder method calls for one object as per vlax-dump-object. What is this argument? In looking at the .NET documentation the argument is the AeccDisplayOrientation enumerator. In looking forward at the AeccDisplayOrientation enumerator it is one of four items: aeccDisplayOrientationPlan aeccDisplayOrientationModel aeccDisplayOrientationProfile aeccDisplayOrientationSection None of these work as arguments as either a string or a quoted symbol. I find the conversion is typically an integer. I had guessed that plan was 1, model was 2, and so fourth. (I tried both 1 and 2 as the argument and didn't see a difference.) One needs to be careful as to which is appropriate for the object you are extracting the border from. Access Violation will occurs when 3 or 4 is used on a Tin Surface. (At least in my recent testing that's what occurred.) regards, Hippe013 Quote
Paraglide1 Posted March 7, 2014 Author Posted March 7, 2014 Thanks Hippie, I just recently discovered the optional argument for VLAX-DUMP-OBJECT that causes the methods to be listed. I saw 'extractborder when dumping the surface object but could find nothing to tell me the actual parameters for using it. Very good tip for figuring that out. Quote
Paraglide1 Posted March 9, 2014 Author Posted March 9, 2014 Hippie said he looked at .net documentation to find arguments for Visual Lisp methods. Or did you want to know something else? 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.