TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Peter2 on November 01, 2016, 07:41:02 AM

Title: How to get "insunits" from an existing block?
Post by: Peter2 on November 01, 2016, 07:41:02 AM
Edit: Solved

I have a drawing "test.dwg", where the block "myblock" was already inserted from "myblock.dwg".
How to get "insunits" from this already existing block? Should be easy, but at the moment I don't find the way  :embarrassed:

Thanks

Peter
Title: Re: How to get "insunits" from an existing block?
Post by: Peter2 on November 01, 2016, 08:59:49 AM
Found it - here is the way via "entlast":

Code - Auto/Visual Lisp: [Select]
  1. (vlax-get-property (vlax-ename->vla-object  (entlast)) "insunitsfactor")
Title: Re: How to get "insunits" from an existing block?
Post by: ScottMC on February 21, 2018, 11:31:37 AM
Found this alternate that works for me A2K..
http://www.theswamp.org/index.php?topic=27342.msg329051#msg329051
Title: Re: How to get "insunits" from an existing block?
Post by: Lee Mac on February 21, 2018, 01:38:28 PM
Here's another way, using Vanilla AutoLISP:
Code: [Select]
(cdr (assoc 70 (entget (cdr (assoc 330 (entget (tblobjname "block" "myblock")))))))
Reference here (http://help.autodesk.com/view/ACD/2018/ENU/?guid=GUID-A1FD1934-7EF5-4D35-A4B0-F8AE54A9A20A) (see GC 1070).