Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GET ENTITY INFORMATION FOR PARCEL

6 REPLIES 6
Reply
Message 1 of 7
amyyoyo1
685 Views, 6 Replies

GET ENTITY INFORMATION FOR PARCEL

Hi all,

I am creating a rountie that will requir access to the style of the parcel but I cann't seem to find it in the entity list.

 

any idea why? and how can I get assess to it?

 

Please and Thanks

here are  part of the code

(setq idy -1)
(repeat (sslength sel2)
(setq ent2 (ssname sel2 (setq idy (+ 1 idy))))
(setq spa1 (vlax-ename->vla-object ent2))

(if (= (setq name2 (vlax-get spa1 'StyleName)) "WELL SITE")
(progn


(vla-put-stylename spa1 "AECCESS ROAD"); 
)




);end if
);repeat end
));end if
);end progn
)
)

6 REPLIES 6
Message 2 of 7
Kent1Cooper
in reply to: amyyoyo1


@amyyoyo1 wrote:

.... I am creating a rountie that will requir access to the style of the parcel but I cann't seem to find it in the entity list.

 

any idea why? and how can I get assess to it?

 

Please and Thanks

here are  part of the code

....

(if (= (setq name2 (vlax-get spa1 'StyleName)) "WELL SITE")
(progn
(vla-put-stylename spa1 "AECCESS ROAD"); 
....


Are you talking about Text objects?  It ought to be able to work with the StyleName property, and you can also get it from (assoc 7) in the entity data list.  But if a "parcel" is some kind of Civil overlay-program specialty object, you might get a better response on the the Forum dedicated to that program.

 

The (=) function with text strings is case-sensitive, so it won't match if the StyleName property is actually, for example, "Well Site".  If that might be the problem, try forcing it to be upper-case to compare to your upper-case name:

 

(if (= (setq name2 (strcase (vlax-get spa1 'StyleName))) "WELL SITE")

Kent Cooper, AIA
Message 3 of 7
amyyoyo1
in reply to: Kent1Cooper

it's one of the civil 3d function that creat a hatch on a close pline.

I looked into it abit deeper and realize that the style is attach under the parcel but not under the parcel semgment, and I need to use the parcel style as one of my filter condition. 

Not sure that clear things more....

Message 4 of 7

You really cannot use LISP to access Civil 3d objects, it needs to be done in .NET, that being said you can use your lisp to call the .NET and should be able to pass the style name.
Message 5 of 7

Hi,

 

I don't think that you can't access Civil 3D objects with lisp, maybe that's true for plain Autolisp, but with VisualLisp you certainlly can, but I'm not sure if the PARCEL object it's exposed to the API. The first thing to do it's dump the object to browse it's properties: (vlax-dump-object (vlax-ename->vla-object (car(entsel))))

 

Gaston Nunez

Message 6 of 7
Ajilal.Vijayan
in reply to: amyyoyo1

This will get the parcel style name in C3D 2012.

 

(SETQ CadApp (VLAX-GET-ACAD-OBJECT));Get AutoCAD Object
(setq C3dApp (vla-getinterfaceobject CadApp "AeccXUiLand.AeccApplication.9.0"));2012 C3D
(setq C3Ddoc (vla-get-activedocument C3dApp));Get Active Document
(setq prclstyles (vlax-get C3Ddoc 'parcelstyles));Get Parcel Styles
(setq style1 (vlax-get-property prclstyles 'item "WELL SITE"));get the parcel Style name WELL SITE
(mapcar 'vlax-release-object (list C3Ddoc C3dApp CadApp));release objects

 

 

 

Message 7 of 7

And here's the code

 

(vl-load-com)
(defun c:ChangeParcelStyle ( / prcl style1)
(SETQ CadApp (VLAX-GET-ACAD-OBJECT));Get AutoCAD Object
(setq C3dApp (vla-getinterfaceobject CadApp "AeccXUiLand.AeccApplication.9.0"));2012 C3D
(setq C3Ddoc (vla-get-activedocument C3dApp));Get Active Document
(setq prclstyles (vlax-get C3Ddoc 'parcelstyles));Get Parcel Styles
(setq style1 (vlax-get-property prclstyles 'item "AECCESS ROAD"));get the parcel Style name WELL SITE
(mapcar 'vlax-release-object (list C3Ddoc C3dApp CadApp));release objects


(setq prcl (entsel "\nSelect Parcel:"))
(setq prcl (vlax-ename->vla-object (car prcl)))

(vlax-put-property prcl 'Style style1 )

);defun

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost