Code Red > AutoLISP (Vanilla / Visual)

Civil 3D Feature Line Getpoints method

(1/3) > >>

AJILALV:
Hi,

I am trying to get the Points collection from the Civil3d feature line.
The featureline have a method Getpoints(1).

The below lisp code giving me an error on this  line -> (vlax-invoke-method FLE 'GetPoints FLE)
error: lisp value has no coercion to VARIANT with this type:  #<VLA-OBJECT IAeccLandFeatureLine 0000000028537610>

Code:
------------------
(vl-load-com)
(defun c:FLBL ( / FLE acadOBject acadDocument mSpace)
(setq acadOBject (vlax-get-acad-object))
(setq acadDocument (vlax-get-property acadObject 'ActiveDocument))
(setq mSpace (vlax-get-property acadDocument 'Modelspace))
(setq FLE (car (entsel "\nSelect the featureline: ")))
(setq FLE (vlax-ename->vla-object FLE))
(vlax-dump-object FLE T)

(vlax-invoke-method FLE 'GetPoints FLE)

);defun
-----------------------------------------------------------

I am using Civil3D 2012.


Thanks
AJIL

BlackBox:
First, welcome to TheSwamp!

Consider this example:


--- Code - Auto/Visual Lisp: ---(vl-load-com) (defun c:FOO (/ ss)  (princ "\rSelect a feature line to return points: ")  (princ    (if (setq ss (ssget ":S:E" '((0 . "AECC_FEATURE_LINE"))))      (vlax-invoke        (vlax-ename->vla-object (ssname ss 0))        'getpoints      )      "\n** Nothing selected ** "    )  )  (princ)) 

AJILALV:
Hi
--- Quote from: RenderMan on August 07, 2012, 08:45:06 am ---First, welcome to TheSwamp!

Consider this example:


--- Code - Auto/Visual Lisp: ---(vl-load-com) (defun c:FOO (/ ss)  (princ "\rSelect a feature line to return points: ")  (princ    (if (setq ss (ssget ":S:E" '((0 . "AECC_FEATURE_LINE"))))      (vlax-invoke        (vlax-ename->vla-object (ssname ss 0))        'getpoints      )      "\n** Nothing selected ** "    )  )  (princ)) 
--- End quote ---

Thanks!!!!!!!!!!!!!!.............It works.

BlackBox:

--- Quote from: AJILALV on August 07, 2012, 09:06:31 am ---
Thanks!!!!!!!!!!!!!!.............It works.

--- End quote ---

You're welcome; I'm happy to help.  :-)

AJILALV:
Hi again,

But 2 doubts......

1) So Vlax-invoke should use instead of Vlax-invoke-method in future ?
whats the main difference with these two ?
I found the topic for vlax-invoke-method http://www.theswamp.org/~john/avlisp/#vlax-invoke-method
But not for vlax-invoke

2)How can I paste the code like you did ?.............


Thanks again.

Navigation

[0] Message Index

[#] Next page

Go to full version