Recent Posts

Pages: [1] 2 3 ... 10
1
AutoLISP (Vanilla / Visual) / Re: How to make a reactor to enable rxxx commands.
« Last post by CAB on July 23, 2014, 10:29:13 pm »
Yes decimal points are not allowed in function names. No way around that that I see.

Strings in the radius like 3r can be trapped. And this will do that
Code: [Select]
    (defun c:mf (/ fr)
     (if (and (setq fr (getstring "\nEnter fillet distance. "))
              fr (not (zerop (atof fr)))
              (not (wcmatch fr "*[~0123456789.]*")))
       (progn ........

Back to your fractions, like 5.5
The only way I see to deal with it is to create a routine like this, that starts and waits for the radius.

Enter fc <space> or <enter> then the 5.5 <enter>
Code - Auto/Visual Lisp: [Select]
  1. (defun c:fc (/ fr) ; not sure the FC short cut is being used by ACAD
  2.  (if (and (setq fr (getstring "\nEnter fillet distance. "))
  3.           fr
  4.           (not (zerop (atof fr)))
  5.           (not (wcmatch fr "*[~0123456789.]*"))
  6.      )
  7.    (progn
  8.      (setvar "filletrad" (atof fr))
  9.      (vl-cmdf "_.fillet")
  10.      (while (< 0 (getvar 'cmdactive)) (vl-cmdf "\\"))
  11.      (princ)
  12.    )
  13.    (princ "\nInvalid radius.")
  14.  )
  15.  (princ)
  16. )
2
Code - Auto/Visual Lisp: [Select]
  1. (defun c:mf (/ fr)
  2.  (if (and (setq fr (getstring "\nEnter fillet distance. "))
  3.           fr (not (zerop (atof fr))))
  4.    (progn
  5.      (eval
  6.        (vl-list* 'defun
  7.                  (read (strcat "c:r" fr)) 'nil (list 'setvar ''filletrad (atof fr))
  8.                  '((vl-cmdf "_.fillet")
  9.                    (while (< 0 (getvar 'cmdactive)) (vl-cmdf "\\"))
  10.                    (princ)
  11.                   )
  12.        )
  13.      )
  14.      (princ (strcat "\nCommand R" fr " created"))
  15.    )
  16.    (princ "\nFailed to create a command.")  
  17.  )
  18.  (princ)
  19. )

Works fine.the only problem is this.
command: mf
Enter fillet distance. 5.5

Command R5.5 created

command:
command: r5

command: dra DIMRADIUS

mf a fillet 5.5 command,but it only can use by r5 but not r5.5.the messenger"Command R5.5 created"is not correct.

another thing.

command: mf
Enter fillet distance. dsa
Failed to create a command.

command:
command:  MF
Enter fillet distance. 3r
Command R3r created

command:
command: r3r
command: dra DIMRADIUS

atof Function
 



Converts a string into a real number

(atof string)

Arguments

string

A string to be converted into a real number.

Return Values

A real number.

command: (atof "r3r")
0.0

command: (atof "3")
3.0
3
AutoLISP (Vanilla / Visual) / Re: How to make a reactor to enable rxxx commands.
« Last post by Lee Mac on July 23, 2014, 04:34:54 pm »
I was trying to improve fillet:callback so that it would run the newly created function.
To my surprise only the first piece of code works (insert code before the final princ statement).

Feel free to modify the code as you see fit!

In my brief tests, the defined function was automatically being evaluated following evaluation of the callback function, as I too initially thought vla-sendcommand would be required within the callback function.
4
AutoLISP (Vanilla / Visual) / Re: SheetSetManager + Lisp ?
« Last post by BlackBox on July 23, 2014, 04:33:05 pm »
As I understand it, the SSM API is only exposed to VBA and .NET... At best, you'd have to use .NET to develop some sort of schmancy library of custom .NET LispFunction Methods in order to expose specific LISP Data-Typed Properties (no passing SSM Objects to ResultBuffer), and Methods to LISP API (untested).

Cheers
5
AutoLISP (Vanilla / Visual) / Re: SheetSetManager + Lisp ?
« Last post by kruuger on July 23, 2014, 04:17:46 pm »
hello
any info so far ?

k.
6
AutoLISP (Vanilla / Visual) / Re: Vlisp to control palette icon view
« Last post by CmdrDuh on July 23, 2014, 03:46:34 pm »
What is frustrating is when I switch the palette path, it resets to the big list that is worthless.  Does Autodesk think we have such huge monitors that we only need 1 icon per line?
7
Land Lubber / Geographically Positioned / Re: Bearing input
« Last post by mjfarrell on July 23, 2014, 01:12:15 pm »
wow ...... that sucks! Found the problem though.

Code: [Select]
Current direction unit: degree, Input: DD°MM'SS.SS"
>>Specify bearing: 89d14'11.2"
No worse than how one MUST key-in Arch dimensions when using those units.
8
Land Lubber / Geographically Positioned / Re: Combine 2 commands to one?
« Last post by tedg on July 23, 2014, 11:41:06 am »
Correct however most if not all NEW users to C3D do not need the confusion of seeing customized commands or functions
during their training sessions. So I would be doing them no favour to have MY installation of C3D customized to any degree
during a training class. 
Yes it is fantastic that we can customize and build commands to suit our needs!  Again, must don't need to be confused by
seeing commands or function that they will not have access to, right Out of the Box.

And along those lines, this is where I also disagree with most 'implementation' plans that include the establishment of
a 'templates' prior to training. As for me it is imperative that the users ALL know the how and why of Styles creation, and feature settings. But not teaching them these things does them a disservice in the long run.

I think that's a difference from being in a position of training new users versus being a long-time professional working in the industry working in an established office with office standards and procedures. I agree that all new users need to learn how to create things from scratch and why things are set up the way they are in the native program. They don't always have that level of training when they get a cad job.
 
So yes if you're in a position of training new people, it's best to use OOTB tools etc.
 
If I'm helping someone at thier computer, I need to remember what the native commands are on thier machine, because all my cool tricks won't work.
9
Land Lubber / Geographically Positioned / Re: Bearing input
« Last post by Mark on July 23, 2014, 10:20:10 am »
wow ...... that sucks! Found the problem though.

Code: [Select]
Current direction unit: degree, Input: DD°MM'SS.SS"
>>Specify bearing: 89d14'11.2"
10
Land Lubber / Geographically Positioned / Re: Bearing input
« Last post by Mark on July 23, 2014, 10:15:26 am »
you would go to drawing settings, ambient settings and set
Direction>>>>Format DD MM SS.SS
that is what it is set at currently. *shrug*

Code: [Select]
>>Specify quadrant (1-4): 2
Current direction unit: degree, Input: DD° MM' SS.SS" (spaced)
>>Specify bearing: 89 >> <- space here same as enter
Pages: [1] 2 3 ... 10