Author Topic: Check the field of the attribute  (Read 263 times)

0 Members and 1 Guest are viewing this topic.

jasonwebster

  • Mosquito
  • Posts: 1
Check the field of the attribute
« on: July 13, 2021, 11:44:55 PM »
Hi, I want to perform a check if a particular tag value contains a field or not? If it is, then the code will ignore the attribute if the field is present. Can it be done?
Any help? Thanks!


BIGAL

  • Swamp Rat
  • Posts: 830
  • 30 + years of using Autocad
Re: Check the field of the attribute
« Reply #1 on: July 14, 2021, 03:59:55 AM »
Just get textstring for the attribute use VL, then wcmatch to look for a part string of a field like "%<\AcObjProp"
A man who never made a mistake never made anything

roy_043

  • Water Moccasin
  • Posts: 1876
  • BricsCAD 18
Re: Check the field of the attribute
« Reply #2 on: July 14, 2021, 07:43:44 AM »
Code - Auto/Visual Lisp: [Select]
  1. ; (has-field-p (car (nentsel)))
  2. (defun has-field-p (ename)
  3.   (and
  4.     (setq extDict (cdadr (member '(102 . "{ACAD_XDICTIONARY") (entget ename))))
  5.     (dictsearch extDict "ACAD_FIELD")
  6.   )
  7. )