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
)
)
@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")
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....
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
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
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