Select to view content in your preferred language

Esri_Attribute_Get Not Pulling Domain Values

68
2
yesterday
TheRrrr42
Regular Contributor

Hello,

I'm working on an AutoLISP script to create labels with a selection of entities from multiple Feature Layers in AutoCAD. When using Esri_Attributes_Get with an entity name and without specifying a feature layer I'm failing to see the domained values i expect to see. For example; returning 6 vs '6"' or 32 vs 'Cast Iron Pipe'. 

In another script of mine that labels an entire feature layer and uses the "FLNAME" argument the values come in with the correct domain description. Below is a snippet of my script.


(defun c:LabelSelection (/ feats featsLength featsCount entList entName fieldCount label featureAttributes) 
	(setq feats (ssget '((-4 . "<NOT") (0 . "*POLYLINE") (-4 . "NOT>"))))
	(setvar "CMDECHO" 0)
	(setvar "osmode" 0)
	;if selection exists continue
	(if feats
		;determine number of features and get all entities into a list and that list length
		(progn
			(setq featsLength (sslength feats))
			(setq featsCount 0)
			(setq entList nil)
			(repeat featsLength
				(setq entName (ssname feats featsCount))
				(if entName
					(setq entList (cons entName entList))
				);if
				(setq featsCount (+ 1 featsCount))
			);progn
			(setq entList (reverse entList))
			
			;for each entity get its attributes
			(foreach entName entList
				(setq fieldCount 0)
				(setq label "")
				(setq fieldsToLabel nil) ; Clear previous asset properties
				
				(setq featureAttributes (esri_attributes_get entName))

 

Is there any way to get this to return the domain values? 

Also is it possible to get LISP as a code sample language?

0 Kudos
2 Replies
DanWade
Esri Contributor

Hello @TheRrrr42,

Nice to see you working with the ArcGIS for AutoCAD API and AutoLISP.

I think the key to your issue is as you mention that your other AutoLISP method utilizes the "flname" but not in this new (esri_attributes_get) method. The first bullet of the usage notes is describing why you are more than likely not seeing a return that is expected.

esri_attributes_get (AutoLISP)

TheRrrr42
Regular Contributor

Thank you for the reply Dan!

From your feedback I have come up with a roundabout way to use an entity's AutoCAD Layer name in a wcmatch cond to specify a variable to use as an "FLNAME" argument.  Which appears to be working nicely. 

Do you happen to know if there are any other ways to get the name of the Feature Layer of a specific entity? 

0 Kudos