AndyC Posted November 9, 2010 Posted November 9, 2010 Hi i am trying to setup a block that will automatically incremental number the block on each insertion into the drawing. I am using Keyscape 2010 which would appear to have all of the normal LISP and other customisation options disabled. I am however able to assign a Deisel expression against a block attribute and would be really grateful if anyone has one that would achieve this? thanks AndyC Quote
ReMark Posted November 9, 2010 Posted November 9, 2010 Incremental Numbering macro for AutoCAD LT http://forums.augi.com/showthread.php?t=66337 Quote
AndyC Posted November 9, 2010 Author Posted November 9, 2010 Many Thanks I am however a complete novice. What does it mean i have to set the USER1/2 system variable and where do i do this? I want the incremental number to go 1, 2, 3, 4 etc Quote
ReMark Posted November 9, 2010 Posted November 9, 2010 Perhaps you should try running the macro and see if you, the "user", are prompted for the required information. Try it and let us know what happens. Hey, I only find this stuff for you guys...I normally don't test drive it. I got enough stuff to do as it is. :lol: Quote
AndyC Posted November 9, 2010 Author Posted November 9, 2010 I have run the macro and it does not work. It does not prompt me for the User 1 value and just ends up inserting the word 'setvar' on the screen. repeating the insertion does the same but each time the work is slightly rotated anticlockwise. Here in the text of the command prompt. Command: _text Current text style: "LB" Text height: 3.000 Annotative: No Specify start point of text or [Justify/Style]: Specify height : Specify rotation angle of text : 31.52857146 Enter text: setvar Command: USERR1 Enter new value for USERR1 : 31.52857146 Quote
ReMark Posted November 9, 2010 Posted November 9, 2010 (edited) I'll take a look at it when I have a moment. I'm a bit busy presently. In the meantime don't be surprised if someone else comes along and solves the puzzle before I do. OK. I solved the puzzle. But it's going to cost you. The answer lay right before our eyes. The keyword here is setvar. The macro requires we set USERR1 and USERR2 at the command line since they are variables. So, before running the macro, type USERR1 and set it to whatever you want and do the same for USERR2. Example: set USERR1 to 200 and set USERR2 to 1. Run the macro. As you make your picks the numbers will increment by a value of 1 starting with 201 and going up. That's it. Now, about that payment. Let's see. Yep, I know. A case of.............. Just kidding. Edited November 9, 2010 by ReMark Quote
AndyC Posted November 9, 2010 Author Posted November 9, 2010 Excellant That now works, and i think we are beginning to understand how this works. What we now need to try and do is link this macro to a block rather than to a button as is the current situation. I have seen that there are various macros posted on the forum for various incremental systems that i will take a look at to see if we can develo a more intelligant numbering system. Many thanks for your help AndyC Quote
ReMark Posted November 9, 2010 Posted November 9, 2010 You're entirely welcomed Andy. Good luck. Quote
AndyC Posted November 9, 2010 Author Posted November 9, 2010 ReMark One last favour can you take a look at the following macro and see if you can work out why it does not work. The process stopd after it has inserted the block "LB-setting-out-point" ^c^c-layer;t;LB-T007-SET-OUT;;-layer;m;"LB-T007-SET-OUT";c;WHITE;;l;continuous;;;-insert;"LB-setting-out-point";sc;"~";;_text;\;;$M=$(+,$(getvar,USERR1),$(getvar,USERR2));setvar;USERR1;$M=$(+,$(getvar,USERR1),$(getvar,USERR2)); However if i swap the order round and create the seqential number before inserting the block it works!!!! ^c^c-layer;t;LB-T007-SET-OUT;;-layer;m;"LB-T007-SET-OUT";c;WHITE;;l;continuous;;;_text;\;;$M=$(+,$(getvar,USERR1),$(getvar,USERR2));setvar;USERR1;$M=$(+,$(getvar,USERR1),$(getvar,USERR2));-insert;"LB-setting-out-point";sc;"~";; Quote
ReMark Posted November 9, 2010 Posted November 9, 2010 Re: the first macro. Just before it bombs out what is looking for? Can you post the contents of the Text window when the macro short circuits? Quote
AndyC Posted November 9, 2010 Author Posted November 9, 2010 Here is the text produced when the macro is run. Command: -layer Current layer: "LB-T007-SET-OUT" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck /Unlock/stAte/Description/rEconcile]: t Enter name list of layer(s) to thaw: LB-T007-SET-OUT Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck /Unlock/stAte/Description/rEconcile]: Command: -layer Current layer: "LB-T007-SET-OUT" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck /Unlock/stAte/Description/rEconcile]: m Enter name for new layer (becomes the current layer) : "LB-T007-SET-OUT" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck /Unlock/stAte/Description/rEconcile]: c New color [Truecolor/COlorbook] : WHITE Enter name list of layer(s) for color 7 (white) : Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck /Unlock/stAte/Description/rEconcile]: l Enter loaded linetype name or [?] : continuous Enter name list of layer(s) for linetype "continuous" : Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck /Unlock/stAte/Description/rEconcile]: Command: -insert Enter block name or [?] : "LB-setting-out-point" Units: Millimeters Conversion: 1.000 Specify insertion point or [basepoint/Scale/X/Y/Z/Rotate]: sc Specify scale factor for XYZ axes : "~" Requires numeric distance or two points. Specify scale factor for XYZ axes : 25 Specify insertion point or [basepoint/Scale/X/Y/Z/Rotate]: Specify rotation angle : Enter attribute values Auto Number : Auto Northing : Auto-easting : It does not appear to error out it simply end and does not even try to process the part relating to the incremental numbering Quote
AndyC Posted November 9, 2010 Author Posted November 9, 2010 Here is the text it produces when i run the macro. It does not appear to error out, but simply ends after inserting the block and does not try to even attemp the part relating to the incremental number! Command: -layer Current layer: "LB-T007-SET-OUT" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck /Unlock/stAte/Description/rEconcile]: t Enter name list of layer(s) to thaw: LB-T007-SET-OUT Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck /Unlock/stAte/Description/rEconcile]: Command: -layer Current layer: "LB-T007-SET-OUT" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck /Unlock/stAte/Description/rEconcile]: m Enter name for new layer (becomes the current layer) : "LB-T007-SET-OUT" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck /Unlock/stAte/Description/rEconcile]: c New color [Truecolor/COlorbook] : WHITE Enter name list of layer(s) for color 7 (white) : Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck /Unlock/stAte/Description/rEconcile]: l Enter loaded linetype name or [?] : continuous Enter name list of layer(s) for linetype "continuous" : Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck /Unlock/stAte/Description/rEconcile]: Command: -insert Enter block name or [?] : "LB-setting-out-point" Units: Millimeters Conversion: 1.000 Specify insertion point or [basepoint/Scale/X/Y/Z/Rotate]: sc Specify scale factor for XYZ axes : "~" Requires numeric distance or two points. Specify scale factor for XYZ axes : 25 Specify insertion point or [basepoint/Scale/X/Y/Z/Rotate]: Specify rotation angle : Enter attribute values Auto Number : Auto Northing : Auto-easting : Quote
ReMark Posted November 9, 2010 Posted November 9, 2010 Just curious. You Thaw a layer called LB-T007-SET-OUT and then you also Make a layer with the same name? If you thaw the layer and want to make it current why not use the Set option? Quote
AndyC Posted November 9, 2010 Author Posted November 9, 2010 Well Spotted We used to have a drawing template with all the layers pre set up, but 'Frozen' until they were actually required. This proved a difficult syetem to maintain, and we are prefering having macros that create pre named layers on demand instead. So i guess we don't actually need the Thaw command at all anymore, and could just keep the Make command Quote
ReMark Posted November 9, 2010 Posted November 9, 2010 Is the layer Frozen or not? If it is then you need to Thaw it first, right? Otherwise you're stuck. And the option Set in the -layer command will make the layer you name, in this case LB-T007-SET-OUT, the current one. Then you may proceed with your next command. I see no reason to use Make unless you have to create a new layer. Quote
AndyC Posted November 9, 2010 Author Posted November 9, 2010 The layer is not frozen , so i have removed the command to THAW. The MAkE command is included because the layer does not exist until the person inserts the first block from the drop down menu. Quote
ReMark Posted November 9, 2010 Posted November 9, 2010 Another question re this: Specify scale factor for XYZ axes : "~" Requires numeric distance or two points. Specify scale factor for XYZ axes : 25 Why is the first input a tilde and the second input a number? Quote
AndyC Posted November 9, 2010 Author Posted November 9, 2010 This is so that the system prompts the users to manual set the scale of the block on insertion to match the scale of the drawing. Quote
ReMark Posted November 9, 2010 Posted November 9, 2010 This is so that the system prompts the users to manual set the scale of the block on insertion to match the scale of the drawing. So you don't want the user to merely accept the default of . OK. Quote
AndyC Posted November 10, 2010 Author Posted November 10, 2010 Thanks for all ytour help yesterday. You are correct we do not want to accept the default of but need to specifiy this to the suit the drawing scale. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.