Author Topic: Renumbering Block Attributes numerically/Alphabetically  (Read 6070 times)

0 Members and 1 Guest are viewing this topic.

AVCAD

  • Guest
Renumbering Block Attributes numerically/Alphabetically
« on: February 18, 2009, 01:55:02 PM »
So I tried to write this lsp...but I can not get it to work properly. Its run correctly all the way to the end and then nothing.

It let me run the program, select my blocks/attributes, enter in the starting value, then select all the attributes I want changed and then it stops...I can not figure it out...

This is a lsp I tried to pull together using some code from the gatte.lsp autodesk uses in acad 2008 and snippets from other lsp I have.

If anyone is up for it please help!

Thanks in advance for the help.

GDF

  • Water Moccasin
  • Posts: 2081
Re: Renumbering Block Attributes numerically/Alphabetically
« Reply #1 on: February 18, 2009, 03:42:16 PM »
Maybe this one, check out his web site...

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; =============================================================================
;; Filename    :   ItemIndex.lsp
;; Datum       :   14.01.2002
;; Author      :   jme
;; Copyright   :   MENZI ENGINEERING GmbH
;; Revision  1 :   01.05.2004 jme - Block handling added
;; Revision  2 :   10.06.2004 jme - Bug with fixed height text styles removed
;; Revision  3 :   __.__.____ ___ -
;; -----------------------------------------------------------------------------
;; Description:
;; Item numbering with numbers or letters (1 2 3... or a b c... or A B C...).
;; -----------------------------------------------------------------------------
;; Global variables:
;; Gb:Ill Gb:Ilu Gb:Inu Gb:Mde
;; -----------------------------------------------------------------------------
;; Internal LISP-functions:
;; ChgAttVal ChkChrInp ListToStr GetChrInp ModLstPos IncrChr SelectNumBlock
;; -----------------------------------------------------------------------------
;; External LISP-functions:
;;
;; -----------------------------------------------------------------------------
;; Version notes:
;; AutoCAD:   Version:   Language:   AddIns:
;; 14 up      1.02      English      ...
;; -----------------------------------------------------------------------------
;;
;; == Message on loading =======================================================
;;
;;(princ "\nItemIndex v1.02")
;;
;; == Subs =====================================================================
;;
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

AVCAD

  • Guest
Re: Renumbering Block Attributes numerically/Alphabetically
« Reply #2 on: February 18, 2009, 04:55:41 PM »
can you post the lsp?  i can not find it on his site

thanks!

AVCAD

  • Guest
Re: Renumbering Block Attributes numerically/Alphabetically
« Reply #3 on: February 18, 2009, 05:21:49 PM »
ok i found it. But it tells me that "that is not a NUMBLOCK" when I select a block with attributes...

KewlToyZ

  • Guest
Re: Renumbering Block Attributes numerically/Alphabetically
« Reply #4 on: February 19, 2009, 11:53:24 AM »
There are a few items:
http://management.cadalyst.com/cadman/article/articleDetail.jsp?id=196583

< edit by CAB: code removed due to copyright >

See Increment Attributes (Tip #2069), in the link above for the code
« Last Edit: February 19, 2009, 12:48:50 PM by CAB »

AVCAD

  • Guest
Re: Renumbering Block Attributes numerically/Alphabetically
« Reply #5 on: February 19, 2009, 01:43:53 PM »
Sounds like something that might work. I downloaded the code as a txt files but it says i have to import it into a new project and hit run program? Not sure what that means? I tried in Vlisp but that didnt work. So i need Visual Basic or something?

KewlToyZ

  • Guest
Re: Renumbering Block Attributes numerically/Alphabetically
« Reply #6 on: February 19, 2009, 02:39:12 PM »
There are a few items:
http://management.cadalyst.com/cadman/article/articleDetail.jsp?id=196583

< edit by CAB: code removed due to copyright >

See Increment Attributes (Tip #2069), in the link above for the code

Thanks CAB, didn't think it would be an issue with the reference?
Took forever to dig up the code from the link.

KewlToyZ

  • Guest
Re: Renumbering Block Attributes numerically/Alphabetically
« Reply #7 on: February 19, 2009, 02:41:54 PM »
Sounds like something that might work. I downloaded the code as a txt files but it says i have to import it into a new project and hit run program? Not sure what that means? I tried in Vlisp but that didnt work. So i need Visual Basic or something?

You must have grabbed the vba one.
The ATTINC.lsp & ATTINC.dcl were just drop in support and appload to run.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Renumbering Block Attributes numerically/Alphabetically
« Reply #8 on: February 19, 2009, 02:49:47 PM »
This is the header in the file I have:
Code: [Select]
;;;CADALYST 11/05  Tip2068:   ATTINC.lsp   Incrementing Attribute Values in Blocks  (c) 2005 Jeffery Sanders


;;;--- ATTINC - Increment the value of an attribute in all blocks
;;;
;;;
;;;    Select a block, select the tag name from a list, type
;;;    in your starting value and the increment to use on each
;;;    matching block found.
;;;
;;;
;;;--- Copyright 2005 by JefferyPSanders.com
;;;    All rights reserved
;;;
;;;
;;;
;;;   9/9/05
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

KewlToyZ

  • Guest
Re: Renumbering Block Attributes numerically/Alphabetically
« Reply #9 on: February 19, 2009, 02:55:19 PM »
I had the file from legacy items and looked it up online.
Never had the header but the description matched.

Does the code match between the two ?

--oops, nevermind yes it does, the description is a clear give away.
Thanks for the proper header CAB :D
« Last Edit: February 19, 2009, 03:11:16 PM by KewlToyZ »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Renumbering Block Attributes numerically/Alphabetically
« Reply #10 on: February 20, 2009, 11:59:01 AM »
My pleasure. :-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.