Jump to content

Recommended Posts

Posted

Hi,

I'm trying to change the visibility of the last placed block.

I could not find a way that suited me for the code below.

(defun vblty (/ Visibility1 blk )
     (setq blk (entlast))
  (if (/= Visibility1 "")
	;Place Visibility1 to block
    )
)

 

I have looked at some other topics, but the code is always a bit over my level of LISP understanding.

 

Any help is much appreciated! :)

Posted (edited)

if talking a dynamic block then yes thanks to Lee-mac 1st, then can display visibility values and choose. Works for any dynamic block as it reads the visibility values. You insert block and then visibility values are displayed.

 

Multiradio9.png.4aa769abe91d20b82e06f4b5d68d281a.png

Is this what you want as its 3 lisps, 2 are library functions the dcl and Lee-mac dynamic block functions. let me know will post code.

 

 

Edited by BIGAL
  • Like 2
  • 2 weeks later...
Posted (edited)

Many tanks!

 

@Steven P your line of code was the one missing for me, then used Lee Macs "setdynpropvalue" and it worked 😀

 

 

 

 

Edited by pttr
Posted

Another problem that I have is that the visibility string is lowercase and I need to make sure that whatever value I have it always starts with an uppercase letter.

I tried using this, but it doesn't work for at strings as a variable

Tried Lee Mac´s code to but same problem

http://www.lee-mac.com/textcasefunctions.html

 

Anyone know how to change the first letter of a String as variable to uppercase?

Posted

Strcase will change the case of a string, so abc becomes ABC, you can look at what your typed,  and look at the 1st character strange but there are 52 characters in the English alphabet from a computer perspective, so a=97 A=65 so a "c" becomes 100-32 (chr 68)

 

Useful hints

(ascii (getstring)) (ascii (substr str 1 1))

(chr x)

(substr str 1 1)

 

So can work out any 

Posted
On 3/28/2023 at 12:24 PM, BIGAL said:

Strcase will change the case of a string, so abc becomes ABC, you can look at what your typed,  and look at the 1st character strange but there are 52 characters in the English alphabet from a computer perspective, so a=97 A=65 so a "c" becomes 100-32 (chr 68)

 

Useful hints

(ascii (getstring)) (ascii (substr str 1 1))

(chr x)

(substr str 1 1)

 

So can work out any 

Turns out It was working all along, Problem was a (,) in the start of the word it was trying to make uppercase and therefor it would not compute. Thanks for your contribution!

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...