Jump to content

Problem with vla-addattribute


John E Green

Recommended Posts

Hi All,

 

After much searching I can not find an answer to what seems like a simple problem.

 

I want to use vla-attribute to a block which has just been created in my code :-

 

(vla-insertblock
    (vla-objectidtoobject adoc (vla-get-ownerid (car ss)))
    (vlax-3d point centre)
    (vla-get-name blk)
    1.0
    1.0
    1.0
    0.0
)

 

I have now tried to add the attributes using vla-addattribute, but I can not get it to work. the blk above is the name of the block which is inserted fine and has name e.g Space001 . When I try and add the attributes and I use vla-addAttribute blk (height mode prompt etc) I get error - bad argument type VLA-OBJECT "Space001". If I change the blk to (vla-get-name blk) or (vla-get-block blk) I get error nil VLA-OBJECT.

 

How do get the vla-addattributes to use the block (blk) in the code above, I have tried every combination I can think of including (vlax-ename->vla-object but to no avail.

 

I have managed to get this to work in model space without attaching to a block but can not attach items to the block.

 

Any help will be most welcome

 

John

Link to comment
Share on other sites

Hi Lee,

 

Opps my fault, I picked it up the code and then copied some more code over it without thinking. Now see my problem, I have added an odd bit of code which overwrote the block word in the code. It make sense now and works a treat.

 

Carbon interface has failed on the computer today. I'm not used to the sunshine its gone to my head.

 

Many thanks again for you prompt help. It would be ideal if I did'nt mess it up at my end.

 

Regards

 

John

Link to comment
Share on other sites

If you had all these problems, it would have been nice to have some feedback from the other thread as opposed to the creation of a new thread...

Link to comment
Share on other sites

My error indeed, I didn't realise until I had posted I had started a new thread. Must stop doing two things at once.

 

I had intended to feed back later on original question, I just got side tracked with some thing else.

 

I am finding it hard getting back into lisp after a 10 year break away from it. But I have learnd a vast amount in the last two days.

 

The problems I know are not big they are just bring me to a halt whilst I try and think how to get over the hurdle.

 

Having spent much time programming in OO and SQL its difficult get back in to the swing of lisp and some of the things that use to be second nature to me.

 

I hope I can contribute back to forum soon in recognition of the help I get..

 

John

Link to comment
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
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...