attribute value

Discussion in 'AutoCAD' started by Jan van de Poel, Jun 7, 2004.

  1. Guys,
    is it possible to have an attribute offer the date of today as standar
    value??
    Maybe some programming required.

    Jan
     
    Jan van de Poel, Jun 7, 2004
    #1
  2. If you have a LISP routine to insert the block, you can get the current date
    and add as one of the attributes.

    ;exampe to get current date and save as variable SBDATE in format of
    MM/DD/YY
    (setq DATE (rtos (getvar "CDATE") 2 10))
    (setq YYDATE (substr DATE 3 2) MMDATE (substr DATE 5 2) DDDATE (substr
    DATE 7 2))
    (setq SBDATE (strcat MMDATE "/" DDDATE "/" YYDATE))

    ;example
    (defun C:IB (/ BlkName InsertPoint BlkScale BlkRotate DATE YYDATE MMDATE
    DDDATE SBDATE)
    (setq BlkName "YourBlockName")
    (setq InsertPoint (list 0.0 0.0))
    (setq BlkScale 1.0)
    (setq BlkRotate 0.0)
    (setq DATE (rtos (getvar "CDATE") 2 10))
    (setq YYDATE (substr DATE 3 2) MMDATE (substr DATE 5 2) DDDATE (substr
    DATE 7 2))
    (setq SBDATE (strcat MMDATE "/" DDDATE "/" YYDATE))
    (command "INSERT" BlkName InsertPoint BlkScale BlkScale BlkRotate SBDATE)
    (princ)
    )
     
    Alan Henderson @ A'cad Solutions, Jun 7, 2004
    #2
  3. Jan van de Poel

    OLD-CADaver Guest

    <<If you have a LISP routine to insert the block, you can get the current date and add as one of the attributes>>


    (setq pldate (MENUCMD "M=$(EDTIME, $(GETVAR, DATE),DD-MON-YY HH:MMam/pm)"))
     
    OLD-CADaver, Jun 7, 2004
    #3
  4. Thanks guys,
    i'll give it all a trial.

    Jan

    date and add as one of the attributes>>
    HH:MMam/pm)"))
     
    Jan van de Poel, Jun 8, 2004
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.