ectech 发表于 2022-7-6 10:49:06

thanks for Lee Mac ! But in my case,(setq a(cdr (assoc 270 (entget (xxx)))) if a not equal to 55 then it will call function to perform setup the units. In this case 270 is stand for ?
 
 
 

Lee Mac 发表于 2022-7-6 10:54:24

Well, what is the entity it is querying? i.e. what entity is 'xxx' in your example.

ectech 发表于 2022-7-6 10:57:04

thanks for your reply, it querying the drawing units from the drawing.
 

irneb 发表于 2022-7-6 11:03:14

I think you may be misunderstanding Lee's question. He's asking what entity are you getting the 270 code from, is it a line, a dimension, a style, or any number of other possible graphical or non-graphical entities inside the drawing. Depending on what entity type it is, 270 may have differing meanings - that's why it could mean material of an entity or Dimension Units of a dimension style.
 
When you state you're getting the drawing's measurement units, this is actually saved in a variable called InsUnits and you can get that using (getvar "InsUnits"). From the code and some discussions previously it seems that it's getting the code from a dimension style entity. You can obtain the same by setting the style current and then doing (getvar "DIMUNIT") - which is actually obsolete (use DIMLUNIT & DIMFRAC & DIMLFAC instead). Note a drawing may contain numerous styles which may each have their own "units" - so that even if a DWG is set to (say) Milli Meters, that particular dimension may still display the value in Inches.

ectech 发表于 2022-7-6 11:05:46

thanks ! I wil search pervious code to get the answer.
 
页: 1 [2]
查看完整版本: (assoc 270 (entlast))