Author Topic: executable Lisp in fields  (Read 251 times)

0 Members and 1 Guest are viewing this topic.

nekitip

  • Mosquito
  • Posts: 14
executable Lisp in fields
« on: February 27, 2017, 06:07:56 am »
Hi all!,
I've been playing with fields from .NET, and I'm interested if there is a way to place LISP in a field, so that it executes itself when UPDATEFIELD is commanded for known ObjectID (embeded in field previously by other methods).
I know how to use "%<\AcExpr (...) in fields (without LISP in it), but my trial and error attempts to combine it with LISP have failed.
What I want to place in field is a simple evaluation of distance (length) for curve. Something that may look like
Code - Auto/Visual Lisp: [Select]
  1. %<\AcExpr ...my known objectid...
  2. LISP part (getDistAtParam ... getEndParam)
  3. >% formatting part
  4.  
Thank you

nekitip

  • Mosquito
  • Posts: 14
Re: executable Lisp in fields
« Reply #1 on: March 07, 2017, 10:54:49 am »
Maybe to someone confirm if LISP in field will work at all?
Again, I do not know how to use LISP since i play with .NET, but I came across this site http://www.lee-mac.com/lisp/html/MidLenV1-1.html
and there you can find the line:
Code - Auto/Visual Lisp: [Select]
so I thought, maybe it's posible...
But thinking about it... I guess that executing lisp this way may be a security risk anyway.

BillZndl

  • Bull Frog
  • Posts: 308
  • Manage this!
Re: executable Lisp in fields
« Reply #2 on: March 07, 2017, 01:22:28 pm »
There are plenty of built in curve parameters and functions in .net, if that's what you're looking for, so why not use them?
(see attachments).
I was just about to suggest that!

nekitip

  • Mosquito
  • Posts: 14
Re: executable Lisp in fields
« Reply #3 on: March 08, 2017, 05:54:34 am »
I do use .NET, and I do get to read start-end parameters to get length and do things with that info. What I'm interested is that I would like to be able to insert LISP into field, with the ObjectID that I've obtained earlier (from .NET). That way, whatever I put in field during running of my .NET program, would be able to execute and update field on updatefield command. That way, there would be no problem if a user gets DWG, and starts to move objects. Like I said, there is a powerfull %<\AcExpr part in field (I suggest everyone to test that out, it's really cool), and also, there is a LISP.variable part. I was hoping that there is a slight possibility that a lisp (star-end param) could somehow be also included.
I'm just almost sure that this is not possible, but I'm still hoping if someone will tell me otherwise.

(note: for those suggesting using .Length in field - I know, it is a simple solution, but working only for a few curve types)

huiz

  • Swamp Rat
  • Posts: 755
  • Certified Prof C3D
Re: executable Lisp in fields
« Reply #4 on: March 08, 2017, 07:47:34 am »
You could use Diesel or a Lisp variable but no Lisp program. And if so, I bet Autodesk would remove it as soon as they realise the security risk of that. In the very past it was possible to add VBA scripts to a drawing, it's good that they removed that :-)
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

huiz

  • Swamp Rat
  • Posts: 755
  • Certified Prof C3D
Re: executable Lisp in fields
« Reply #5 on: March 08, 2017, 07:48:50 am »
Or you can write your own tool that supports Lisp inside Fields (or Texts or whatever). Andrea did a nice job with that in Lisp: http://www.theswamp.org/index.php?topic=30471.0
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

nekitip

  • Mosquito
  • Posts: 14
Re: executable Lisp in fields
« Reply #6 on: March 10, 2017, 08:34:08 am »
You could use Diesel or a Lisp variable but no Lisp program.
Or you can write your own tool that supports Lisp inside Fields (or Texts or whatever). Andrea did a nice job with that in Lisp: http://www.theswamp.org/index.php?topic=30471.0

Well, then it's a dead end. The idea was to see if dwg will work (field update) without any help. Because, like I said - I have .NET now, so if I just change this to a lisp program that I also must ship with dwg, than it's almost the same thing. And that is - acceptance factor of out of company users is almost zero.

Btw, thanks for link, it's interesting.