Author Topic: Paper Space Objects  (Read 5415 times)

0 Members and 1 Guest are viewing this topic.

GDF

  • Water Moccasin
  • Posts: 2081
Re: Paper Space Objects
« Reply #15 on: March 28, 2018, 03:16:57 PM »
OOOOOH NICE
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: Paper Space Objects
« Reply #16 on: March 28, 2018, 05:46:50 PM »
Thanks for assisting in my absence Ron :-)

Gary, my Set Attribute Values function may be more applicable (and efficient) for this task -

Code - Auto/Visual Lisp: [Select]
  1. (setq l
  2.     (list
  3.        '("SHTNO"  . "%<\\AcVar ctab>%")
  4.        '("DRHNO"  . "2113AL V1 R0")
  5.        '("PLANNO" . "2113AL Standard")
  6.         (cons "DATE"  (arch:c_date-issue (getvar "tdupdate")))
  7.         (cons "BPSNO" (substr (getvar "dwgprefix") 13 (- (strlen (getvar "dwgprefix")) 13)))
  8.     )
  9. )
  10. (if (setq s (ssget "_x" '((0 . "insert") (2 . "DRHortonTBA") (66 . 1) (410 . "~model"))))
  11.     (repeat (setq i (sslength s))
  12.         (LM:setattributevalues (ssname s (setq i (1- i))) l)
  13.     )
  14. )


ronjonp

  • Needs a day job
  • Posts: 7531
Re: Paper Space Objects
« Reply #17 on: March 28, 2018, 08:12:12 PM »
Thanks for assisting in my absence Ron :)
...
Anytime Lee 😁

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

GDF

  • Water Moccasin
  • Posts: 2081
Re: Paper Space Objects
« Reply #18 on: March 29, 2018, 07:51:39 AM »
Thanks Lee

I love the use of fields for the sheet number...need to catch up here.

Gary
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

GDF

  • Water Moccasin
  • Posts: 2081
Re: Paper Space Objects
« Reply #19 on: March 29, 2018, 01:00:28 PM »
Need help with fields to update attribute

This field works:
("SHTNO"  . "%<\\AcVar ctab>%")

This field does not work:
("DATE" . "%<\\AcVar date>%")
Or this:
("DATE" . "%<\\AcVar Date \f "MMMM d, yyyy">%")
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: Paper Space Objects
« Reply #20 on: March 29, 2018, 01:05:27 PM »
Try:

Code: [Select]
("DATE" . "%<\\AcVar Date \\f \"MMMM d, yyyy\">%")
It is also sometimes necessary to use the UPDATEFIELD command or issue a REGEN for the field to display when populating attribute values.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Paper Space Objects
« Reply #21 on: March 29, 2018, 01:08:29 PM »
Need help with fields to update attribute

This field works:
("SHTNO"  . "%<\\AcVar ctab>%")

This field does not work:
("DATE" . "%<\\AcVar date>%")
Or this:
("DATE" . "%<\\AcVar Date \f "MMMM d, yyyy">%")
You have to esc the \ and " like so: "%<\\AcVar Date \\f \"M/d/yyyy\">%"

DOH .. too slow :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

GDF

  • Water Moccasin
  • Posts: 2081
Re: Paper Space Objects
« Reply #22 on: March 29, 2018, 01:18:45 PM »
Thanks

Forgot to mention, that I tried that also.

The field will not update with the current date.
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

GDF

  • Water Moccasin
  • Posts: 2081
Re: Paper Space Objects
« Reply #23 on: March 29, 2018, 01:24:05 PM »
Unless I double click on the tag to bring up the field dialog box...why?
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: Paper Space Objects
« Reply #24 on: March 29, 2018, 01:29:00 PM »
Forgot to mention, that I tried that also.

The field will not update with the current date.

Did you try UPDATEFIELD or REGEN?


GDF

  • Water Moccasin
  • Posts: 2081
Re: Paper Space Objects
« Reply #25 on: March 29, 2018, 01:32:12 PM »
No, only a regen

Thanks

UPDATEFIELD is the way to go...and now I know and will start using fields.


Thanks guys
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: Paper Space Objects
« Reply #26 on: March 29, 2018, 01:36:47 PM »
No, only a regen

Thanks

UPDATEFIELD is the way to go...and now I know and will start using fields.


Thanks guys

You're welcome Gary.

UPDATEFIELD only seems to be necessary for specific objects (attributes, multileader attributes), but isn't typically required when populating Text or MText with field expressions. Another point worth noting is when changing the field expression held by an object, it is sometimes necessary to clear the content first before populating the content with the new field expression (refer to the method used by my Quick Field program - line 205).

GDF

  • Water Moccasin
  • Posts: 2081
Re: Paper Space Objects
« Reply #27 on: March 29, 2018, 03:06:41 PM »
Will do..Thanks

Just playing around will learning fields:
Code: [Select]
(setq arch#sern (substr (getvar "dwgprefix") 13 (- (strlen (getvar "dwgprefix")) 13)))
(if (/= (ssget "x" '((0 . "insert")(2 . "sc-96"))) nil)(setq arch#scms "Scale = 1/8\" = 1'- 0\""))

(setq l
    (list
       '("SHTNO"  . "%<\\AcVar ctab>%")
       '("DRHNO"  . "2113AL V1 R0")
       '("PLANNO" . "2113AL Standard")
       '("DATE" . "%<\\AcVar Date \\f \"MMMM d, yyyy\">%")
       '("SCALE" . "%<\\AcVar.17.0 Lisp.arch#scms \\f \"%tc3\">%")
       '("BPSNO"  . "%<\\AcVar.17.0 Lisp.arch#sern \\f \"%tc3\">%")
    )
)
[code/]
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64