AutoCAD Architecture Customization
Welcome to Autodesk’s AutoCAD Architecture Customization Forums. Share your knowledge, ask questions, and explore popular AutoCAD Architecture Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AEC Objects, Color and vlax-put-property

2 REPLIES 2
Reply
Message 1 of 3
David_W_Koch
725 Views, 2 Replies

AEC Objects, Color and vlax-put-property

While not directly offered on the Properties palette, you can change the color of an AEC object using the ObjectDisplay command.  I am writing a routine to strip out hard-coded properties from objects in block definitions, and have found that I can usethe vlax-put-property subroutine in AutoLISP on an AEC object to change the layer, linetype, linetype scale, plot style, lineweight, transparency and material, but if I try to use it to set the color, I get an error.

 

The error message displayed at the command line is:

lisp value has no coercion to VARIANT with this type:  nnn

where nnn is the color number I am trying to set.

 

Setting the color this way works fine for AutoCAD objects.  While I doubt this routine would often be used in situations where a hard-coded color has been set to an AEC object, I still need the routine to be able to process AEC objects without crashing and to be able to reset any that have a hard-coded color (at the main object level) to "BYLAYER".  It looks like I will have to do this "old school", with ENTGET and ENTMOD, unless someone knows of a way to get vlax-put-property to work for colors on AEC objects.

 

(Note also that vlax-property-available-p indicates that color is an available property and that it is also editable.)


David Koch
AutoCAD Architecture and Revit User
Blog | LinkedIn
EESignature

2 REPLIES 2
Message 2 of 3
David_W_Koch
in reply to: David_W_Koch

I thought I had linetype scale and lineweight working for AEC objects in ACA 2010, but they do not work for them in ACA 2013.  I guess I will need to treat AEC objects differently for linetype scale and lineweight also.  (As well as test the routine in ACA 2014 to see if anything else fails there.)


David Koch
AutoCAD Architecture and Revit User
Blog | LinkedIn
EESignature

Message 3 of 3
Gary_J_Orr
in reply to: David_W_Koch

My guess is that you're not using AEC object types for the entities that you're encountering and trying to treat everything as AutoCad Objects... I think you're probably running into a core object programming level issue here. AEC Objects have "autoCAD" as their core but have been programmed to override such basic level manipulations and Vlax functions (propertyavailable-p) can't report if another programming level has negated those core level aspects of those basic object properties (again, all at a guess).

So, while VLAX reports that the core "AutoCAD" property is available for editing, the inheritance of that core Acad property into the AEC object, those objects then override that property so it can be controlled by the display system (and boy have they gotten carried away with the overrides there in recent releases trying to become "Revit-like" and get away from layers, and the control granted by such for lineweight linetype and color, and do everything with overrides in the materials).

Anyway, back to the point, When you attempt to change it AEC says "no, no, no" (even though AutoCAD says "yes, yes, yes") and there you go... forcing the change at the entity level may very well destabilize your objects and therefore the drawing(s).

Gary J. Orr
(Your Friendly Neighborhood) CADD/BIM/VDC Applications Manager
http://www.linkedin.com/in/garyorr

aka (current and past user names):
Gary_J_Orr (GOMO Stuff 2008-Present); OrrG (Forum Studio 2005-2008); Gary J. Orr (LHB Inc 2002-2005); Orr, Gary J. (Gossen Livingston 1997-2002)

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

Post to forums  

Autodesk Design & Make Report

”Boost