TheSwamp
CAD Forums => CAD General => Topic started by: MSTG007 on May 19, 2015, 07:53:42 AM
-
I am trying to write a simple macro that will reset the visretain on a selected xref and reload it. I know I can get away with it when I reload all (*). How can I get it to where the user would select an object. I know that the user can pick using the (\).
^C^Cvisretain;0;-xref;reload;(USER SELECTS);visretain;1;
Thank you
-
Look into ENTSEL (http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-9D4CF74D-8B8B-4D66-A952-564AFBA254E7) then use ENTGET (http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-12540DAE-C84B-4BDB-AEEC-DDFE5BE3C42A) and retrieve CODE 2 (http://www.autodesk.com/techpubs/autocad/acad2000/dxf/group_codes_in_numerical_order_dxf_01.htm) with ASSOC (http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-46309786-DAF6-4C28-8448-599FBC8A4F6A).
-
Thanks for sharing this. Here is the macro I am messing with below:
The Command I am using:
^C^Cvisretain;0;-xref;reload;(setq e (entsel "Please choose an object: "));visretain;1;
The Error I am getting:
Command: visretain
Enter new value for VISRETAIN <0>: 0
Command: -xref
Enter an option [?/Bind/Detach/Path/pathType/Unload/Reload/Overlay/Attach] <Attach>: reload
Enter xref name(s) to reload: (setq e (entsel "Please choose an object: "))
Please choose an object: visretain
*Invalid selection*
Expects a point or Last
Please choose an object: nil
Maybe I am not using this in the right sequencing or I need to add more?
-
Looks like the command line version is expecting a name of the xref to reload so it won't let you pick it in that sequence. Do you know what (ENTSEL (http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-9D4CF74D-8B8B-4D66-A952-564AFBA254E7)) returns?
Here's a fish ;)
-
yup it returns this value
Please choose an object: visretain
*Invalid selection*
Expects a point or Last
Please choose an object: (<Entity name: 7ffffb9d880> (188827.0 1.73852e+006 0.0))