Jump to content

insert a field using LISP


Recommended Posts

hi all, can someone help me make this process shorter...

 

 

 

what i do is like this:

 

 

- select an attributed block

 

- insert a field

 

- in the Field Names i select object then i choose another attributed block for the value or viewport for the custom scale i need

 

- in the Object Type Property I select value or custom scale

 

- in the format I select uppercase or 1: # (if i select custom scale) then click ok.

Edited by nod684
Link to post
Share on other sites
You could create a program using my Quick Field utility to perform this task.

 

hi lee, can you help me with the format for the value?

im trying to incorporate it in your QuickField lsp...

 

(see attached)

field.png

Link to post
Share on other sites
hi lee, can you help me with the format for the value?

im trying to incorporate it in your QuickField lsp...

 

For the property & formatting code shown in your image, you would need to use:

(defun c:test ( ) (LM:QuickField "TextString" "%tc1" 1))

However, since the program doesn't allow you to select nested objects (such as attributes) by default, you will also need to change line 248 from:

(list 'if '(setq ent (LM:SelectIfHasProp prop entsel))

to:

(list 'if '(setq ent (LM:SelectIfHasProp prop [color=red]n[/color]entsel))

  • Thanks 1
Link to post
Share on other sites
For the property & formatting code shown in your image, you would need to use:

(defun c:test ( ) (LM:QuickField "TextString" "%tc1" 1))

However, since the program doesn't allow you to select nested objects (such as attributes) by default, you will also need to change line 248 from:

(list 'if '(setq ent (LM:SelectIfHasProp prop entsel))

to:

(list 'if '(setq ent (LM:SelectIfHasProp prop [color=red]n[/color]entsel))

 

thanks Lee, will try this one out

 

EDIT :

was able to select the nested attribute to the target attribute but its displaying as ####

Link to post
Share on other sites
thanks Lee, will try this one out

 

EDIT :

was able to select the nested attribute to the target attribute but its displaying as ####

 

Does a regen cause it to display correctly?

  • Thanks 1
Link to post
Share on other sites
Does a regen cause it to display correctly?

 

 

 

yes it did. Thank you.!

 

one more thing if its not too much to ask.

what format will i use if i want to insert the scale of the viewport thru field?

Scale.jpg

Edited by nod684
Link to post
Share on other sites
yes it did. Thank you.!

 

You're welcome!

 

one more thing if its not too much to ask.

what format will i use if i want to insert the scale of the viewport thru field?

 

I'm happy to guide you, but could you please post a clearer image of the Field dialog, as the image that you have attached is too pixelated to decipher the field code - ensure the image is saved as a vector format such as png/gif and is not larger than 800x600 otherwise the forum will automatically convert the image to a jpg and scale it down.

  • Thanks 1
Link to post
Share on other sites
You're welcome!

 

 

 

I'm happy to guide you, but could you please post a clearer image of the Field dialog, as the image that you have attached is too pixelated to decipher the field code - ensure the image is saved as a vector format such as png/gif and is not larger than 800x600 otherwise the forum will automatically convert the image to a jpg and scale it down.

ScreenShot001.png

 

sorry about that...here is a bigger image

 

and heres the field expression





%<\AcObjProp Object(%<\_ObjId 8796086054176>%).CustomScale \f 
"1:%lu2%ct1%qf2816">%

Link to post
Share on other sites

Thank you - in that case you could define a program with the following parameters:

(defun c:test ( ) (LM:QuickField "CustomScale" "1:%lu2%ct1%qf2816" 1))

Do you see the pattern and understand how the sections are taken from the field code?

  • Thanks 1
Link to post
Share on other sites
Thank you - in that case you could define a program with the following parameters:

(defun c:test ( ) (LM:QuickField "CustomScale" "1:%lu2%ct1%qf2816" 1))

Do you see the pattern and understand how the sections are taken from the field code?

 

thanks a lot for the help Lee. I appreciate it a lot.

yes my mistake...i fo like this :

(defun c:test ( ) (LM:QuickField "Scale" "CustomScale" "1:%lu2%ct1%qf2816" 1))

again thank you! :)

and thanks too to pBe fo the vla-regen

cheers guys!

Link to post
Share on other sites
  • 9 months later...

Hi Lee,

 

How can I get dynamic block user parameter value with QuickField lisp. ?

 

%<\AcObjProp Object(%<\_ObjId 140694963280112>%).Parameter(96).UpdatedDistance \f "%lu2%pr0">%

Link to post
Share on other sites
Hi Lee,

 

How can I get dynamic block user parameter value with QuickField lisp. ?

 

%<\AcObjProp Object(%<\_ObjId 140694963280112>%).Parameter(96).UpdatedDistance \f "%lu2%pr0">%

 

This is unfortunately not possible using my Quick Field program.

Link to post
Share on other sites
  • 3 years later...

Hi everyone!

Could someone write a LISP for copying text contents from text 1 to text 2, and when the contents of text 1 change, then the contents of text 2 will automatically update contents from text 1! Thank you

Link to post
Share on other sites
10 hours ago, vtb_bmstu said:

Could someone write a LISP for copying text contents from text 1 to text 2, and when the contents of text 1 change, then the contents of text 2 will automatically update contents from text 1! Thank you

 

You can use my existing Quick Field program for this task, defining a custom command such as:

(defun c:tcopy ( ) (LM:quickfield "Textstring" "" 1))

quickfieldtcopy.gif.ee499a6faabb995d2b37c9ba5c95f8cb.gif

Edited by Lee Mac
  • Like 2
  • Thanks 1
Link to post
Share on other sites
  • 1 month later...

Yes! I've figured it out with your great Quick Field, but with little help of your other post:

Thank you! For one of types of my projects, that is great!

But today I faced with small complication.

 

Situation: I have dozens of projects with dozens of block in each (few types). These blocks has 3 or 4 attributes, but each attribute has few data types in it separated with comas. Blocks acts like annotation objects and at the end are exported to tables/excel sheets etc.

I need to place field with length value but only in very particular place of string in attribute. I know, that is achievable by formatting field, but it's to difficult with many block and types of data in it.

Best idea to manage my problem is to make similar lisp as your QuickField but instead of replacing attribute content it would copy field code into clipboard, so it would be pasted in right way while editing attribute. 

Thanks again. Would you Lee and guys point me the way to place field code to clipboard? 

Link to post
Share on other sites
  • 1 year later...
mark_kostic
On 2/6/2015 at 9:28 PM, Lee Mac said:

You could create a program using my Quick Field utility to perform this task.


Hi Lee, can you please help me to implement next one in the quickfield:

Filename screenshot.png

Link to post
Share on other sites
Lee Mac
5 hours ago, mark_kostic said:

Hi Lee, can you please help me to implement next one in the quickfield:

 

My QuickField application is designed to generate fields which reference object properties, and so may only be used to generate field expressions found under the 'Object' category within the FIELD command dialog. As @tombu has helpfully suggested, field expressions with no dependence on Object IDs may be embedded directly within a template without losing the ability to update the field value.

  • Like 2
Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...