#<VLA-OBJECT IAeccPoint3d

#<VLA-OBJECT IAeccPoint3d

ebarlevi
Advocate Advocate
1,266 Views
9 Replies
Message 1 of 10

#<VLA-OBJECT IAeccPoint3d

ebarlevi
Advocate
Advocate

Hi,

I am trying to obtain the value of a point (the position of a civil 3d structure) like that:

(setq obj (vlax-ename->vla-object (car (entsel))))

(setq p1 (vlax-get-property obj 'Position))

I get:

#<VLA-OBJECT IAeccPoint3d 00000270e7ca4760>

My question:

How to proceed from here to obtain the value of the point?

Thanks,

Eitan

 

 

0 Likes
Accepted solutions (1)
1,267 Views
9 Replies
Replies (9)
Message 2 of 10

pbejse
Mentor
Mentor

@ebarlevi wrote:

I am trying to obtain the value of a point (the position of a civil 3d structure) like that:


This should give you the value on a point in list format. If position is available as properties for obj

(vlax-get obj 'Position)

If not, you can always see what properties are available for any entity using 

(vlax-dump-Object obj)

Otherwise, post a drawing sample and tell us more on what you're after

 

 

0 Likes
Message 3 of 10

hosneyalaa
Advisor
Advisor
(setq obj (vlax-ename->vla-object (car (entsel))))
(setq p1 (LIST (vlax-get-property (vlax-get-property obj'Position) 'X)(vlax-get-property (vlax-get-property obj'Position) 'Y) (vlax-get-property (vlax-get-property obj'Position) 'Z)))
0 Likes
Message 4 of 10

hosneyalaa
Advisor
Advisor

If you have questions
About civil 3d
from herehttps://forums.autodesk.com/t5/civil-3d-customization/bd-p/190 

 

 

0 Likes
Message 5 of 10

hak_vz
Advisor
Advisor

Dive into AECC point definition end extract what you need. I don't use Civil 3d so I can't help you directly

 but you can:

 

(vlax-dump-object p1 T) and extract properties and methods of AECC point-

 

(setq pt (vlax-invoke-method p1 'Getpoint)) or

(setq x (vlax-get p1 'x))

(setq y (vlax-get p1 'y))

(setq z (vlax-get p1 'z))

 

Check developers help in Civil 3d or check this link

 

 

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 6 of 10

ebarlevi
Advocate
Advocate
Accepted solution

👍

Thanks a lot.

Exactly what I needed.

Eitan

0 Likes
Message 7 of 10

hosneyalaa
Advisor
Advisor

SEE THIS

https://forums.autodesk.com/t5/civil-3d-customization/export-data-from-the-pipenetworks-to-csv/m-p/10335982#M20165
0 Likes
Message 8 of 10

calderg1000
Mentor
Mentor

Hello @ebarlevi

Maybe this will help. If I already solve it, that's good; then don't take it into account.

(defun c:Coords()
(setq msp(vla-get-modelspace(vla-get-activedocument(vlax-get-acad-object))))      
(setq obj (vlax-ename->vla-object (car (entsel)))
	p1 (vlax-safearray->list(vlax-variant-value(setq plv(vlax-get-property obj 'Location)))))
(vla-addtext msp (strcat" E:"(rtos(nth 0 p1)2 3)" N:"(rtos(nth 1 p1)2 3)" Z:"(rtos(nth 2 p1)2 3)")") plv 2)
)

 


Carlos Calderon G
EESignature
>Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

Message 9 of 10

Sea-Haven
Mentor
Mentor

As you implied a Civ3d object you should select then check what is it, vla-get-objectname, use a cond to say get position, if its say a aeccogopoint better using a ssget with correct filter.

0 Likes
Message 10 of 10

calderg1000
Mentor
Mentor

Select only Cogo points

 

(defun c:Coords (/ msp s i obj p1 plv)
  (setq	msp (vla-get-modelspace
	      (vla-get-activedocument (vlax-get-acad-object))
	    )
  )
  (if (setq s (ssget '((0 . "aecc_cogo_point"))))
    (repeat (setq i (sslength s))
      (setq obj	(vlax-ename->vla-object (ssname s (setq i (1- i))))
	    p1	(vlax-safearray->list
		  (vlax-variant-value
		    (setq plv (vlax-get-property obj 'Location))
		  )
		)
      )
      (vla-addtext
	msp
	(strcat	" E:"
		(rtos (nth 0 p1) 2 3)
		" N:"
		(rtos (nth 1 p1) 2 3)
		" Z:"
		(rtos (nth 2 p1) 2 3)
		")"
	)
	plv
	2
      )
    )
    (princ "Pts. not selected. COGO; Repeat Selection ...:")
  )
  (princ)
)

 

 


Carlos Calderon G
EESignature
>Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

0 Likes