Guest cad2007 Posted November 1, 2010 Share Posted November 1, 2010 i have created the new toolbar....Here how can i insert my codes and Commands??plz see the photoshot.....i am using cad2007 version...... Quote Link to comment Share on other sites More sharing options...
Tharwat Posted November 1, 2010 Share Posted November 1, 2010 That was the first step . So create that toolbar , and after that create a new command ( if you do not have one) and drag it on to that new toolbar . That's all. Tharwat Quote Link to comment Share on other sites More sharing options...
BlackBox Posted November 1, 2010 Share Posted November 1, 2010 Danger, Will Robinson! I would highly suggest that you not place your customizations in ACAD.cui, and instead create a new 'Custom.cui' and load that as a partial. Once you've created your toolbar, create a new command, and place your code in the macro field of the new command's properties. See the Developer Documentation for more information. Hope this helps! Quote Link to comment Share on other sites More sharing options...
ReMark Posted November 1, 2010 Share Posted November 1, 2010 Creating a custom toolbar and adding buttons. http://www.ellenfinkelstein.com/AutoCAD_tips_create_custom_toolbar_cui.html Quote Link to comment Share on other sites More sharing options...
Tharwat Posted November 1, 2010 Share Posted November 1, 2010 Danger, Will Robinson! I would highly suggest that you not place your customizations in ACAD.cui, and instead create a new 'Custom.cui' and load that as a partial. Once you've created your toolbar, create a new command, and place your code in the macro field of the new command's properties. See the Developer Documentation for more information. Hope this helps! Hello Renderman. Your suggestion would be a little bit diffecult and time consumption . So to ensure that your data would be in a safe side , you could save all your customazation data to .cui file. What you think ? Thanks Quote Link to comment Share on other sites More sharing options...
Guest cad2007 Posted November 1, 2010 Share Posted November 1, 2010 Creating a custom toolbar and adding buttons. http://www.ellenfinkelstein.com/AutoCAD_tips_create_custom_toolbar_cui.html ReMark i have seen this link..its good..but there is no option mention for insert the code to customazation data to .cui file...So hw to insert the codes...is it possible to fix the actual inside of the code command.......? Quote Link to comment Share on other sites More sharing options...
BlackBox Posted November 1, 2010 Share Posted November 1, 2010 CUI Manipulation is fairly simple, for the non-beginner. It is considered a best practice to create a Custom.cui partial to prevent accidental changes within the Core CUI components (for both Main, and Enterprise CUI's). This also ensures that your customizations are easily transferable to a new software version, and/or a new employer. They're portable. This process is easy, and does not take much time at all. Quote Link to comment Share on other sites More sharing options...
Guest cad2007 Posted November 1, 2010 Share Posted November 1, 2010 through code like [_Button("Offset10", "XYZ", "XYZ IMAGE")]^C^C(command "offset" "10" ) is it possible Quote Link to comment Share on other sites More sharing options...
BlackBox Posted November 1, 2010 Share Posted November 1, 2010 through code like [_Button("Offset10", "XYZ", "XYZ IMAGE")]^C^C(command "offset" "10" ) is it possible Ohhh... another one of those requests. CUI manipulation asside... does it really save you that much time, compared to using OF+Enter and specifying the distance? Quote Link to comment Share on other sites More sharing options...
ReMark Posted November 1, 2010 Share Posted November 1, 2010 Another 15,000 offsets to assign to buttons? Yikes! I'm outta here. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted November 1, 2010 Share Posted November 1, 2010 Another 15,000 offsets to assign to buttons? Yikes! I'm outta here. Well, to be fair, I doubt that was the OP's intended goal. lol However, I think the two threads share a common flaw, trying to automate an already simple task. Developer Foul #176 ... Automation for the sake of automation, and not efficiency. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted November 1, 2010 Share Posted November 1, 2010 I'm inclined to agree - but only partly. For example, say you work in a company which draws a lot of piping, you could create your centreline, then have buttons programmed with specific offsets for the different piping diameters - saving you looking them up, or entering them incorrectly... Just a thought Quote Link to comment Share on other sites More sharing options...
BlackBox Posted November 1, 2010 Share Posted November 1, 2010 I'm inclined to agree - but only partly. For example, say you work in a company which draws a lot of piping, you could create your centreline, then have buttons programmed with specific offsets for the different piping diameters - saving you looking them up, or entering them incorrectly... Just a thought That is a worth while thought, Lee. However, the OP's macro does not include such intelligence, rather a basic predefined offset of 10 units. Admittedly, I have functions (not buttons) for similar purposes, tailored to my state's DOT criteria for drainage pipes (Round, Elliptical, etc.), which factor in pipe wall thickness, min and max slope, etc.. Working with Land Desktop (pre-Civil 3D conflict check), I developed several production tools which determine utility adjustment crossing elevations (above/below), invert elevations at specified locations, site grading utilities, as well as Utility pipe cross section automation. ... But again, those tools were developed for the sake of efficiency. Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 1, 2010 Share Posted November 1, 2010 (defun offsetCreate (low high) ;; Alan J. Thompson, 11.01.10 (if (apply (function and) (mapcar (function (lambda (x) (eq (type x) 'INT))) (list low high))) ((lambda (i) (while (<= low (setq i (1+ i)) high) (eval (list 'defun (read (strcat "c:" (itoa i))) nil (list 'command "_.offset" i) '(princ) ) ) ) ) (1- low) ) ) ) eg. (offsetCreate 0 1000) Create as many offsets as you want - ONLY WORKS WITH INTEGERS (can't have a command name 4.5). low - lowest number high - highest number Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted November 1, 2010 Share Posted November 1, 2010 Pretty much a modification of yours, but perhaps to handle decimals? (defun MakeOffsets ( _min _max _inc ) (repeat (1+ (fix (/ (- _max _min) _inc))) (eval (list 'defun (read (strcat "C:" (vl-string-translate "." "," (vl-princ-to-string _min)))) nil (list 'command "_.offset" _min) (list 'princ) ) ) (setq _min (+ _min _inc)) ) (princ) ) (MakeOffsets 3 6 0.5) Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 1, 2010 Share Posted November 1, 2010 I suppose you could just supply the entire number list (be it real or integer). (defun offsetCreate (numberList) (foreach x numberList (eval (list 'defun (read (strcat "c:" (vl-string-translate "." "-" (vl-princ-to-string x)))) nil (list 'command "_.offset" x) '(princ) ) ) ) ) BTW Lee, I'd use a hyphen over comma since it's located on the number pad. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted November 1, 2010 Share Posted November 1, 2010 I suppose you could just supply the entire number list (be it real or integer). Maybe... depends how many thousand they want to create... Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 1, 2010 Share Posted November 1, 2010 Maybe... depends how many thousand they want to create... Oh, I know, but it's all theoretical crap. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted November 1, 2010 Share Posted November 1, 2010 More fodder for the metaphorical pile... (defun MakeOffsets (_min _max _inc) [color=blue](vl-load-com)[/color] (repeat (1+ (fix (/ (- _max _min) _inc))) (eval (list 'defun (read (strcat "C:" (vl-string-translate "." "," (vl-princ-to-string _min)))) [color=blue](list '/ 'eName)[/color] [color=blue] (list 'if[/color] [color=blue] '(setq[/color] [color=blue] eName[/color] [color=blue] (car (entsel "\n Select Object to Offset: ")))[/color] [color=blue] (list 'vla-offset '(vlax-ename->vla-object eName) _min))[/color] (list 'princ))) (setq _min (+ _min _inc))) (princ)) Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 1, 2010 Share Posted November 1, 2010 More fodder for the metaphorical pile... (defun MakeOffsets (_min _max _inc) [color=blue](vl-load-com)[/color] (repeat (1+ (fix (/ (- _max _min) _inc))) (eval (list 'defun (read (strcat "C:" (vl-string-translate "." "," (vl-princ-to-string _min)))) [color=blue](list '/ 'eName)[/color] [color=blue] (list 'if[/color] [color=blue] '(setq[/color] [color=blue] eName[/color] [color=blue] (car (entsel "\n Select Object to Offset: ")))[/color] [color=blue] (list 'vla-offset '(vlax-ename->vla-object eName) _min))[/color] (list 'princ))) (setq _min (+ _min _inc))) (princ)) LoL I hope they select valid objects and only want them offset to the perspective right. Quote Link to comment Share on other sites More sharing options...
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.