what is the excel sytntax to insert a block with attribute

what is the excel sytntax to insert a block with attribute

Anonymous
Not applicable
1,144 Views
11 Replies
Message 1 of 12

what is the excel sytntax to insert a block with attribute

Anonymous
Not applicable

what is the  excel syntax to insert a block with attribute

0 Likes
1,145 Views
11 Replies
Replies (11)
Message 2 of 12

cadffm
Consultant
Consultant

Hi,

 

Syntax? Figured out yourself, the Syntax is also depending on

used options & blockproperties (uniform scale yes/no).

 

command: -INSERT

Read about ATTREQ and ATTDIA too in your Help [F1]

 

-INSERT

MyBlockname

..and your options and inputs

write it down, keystroke for keystroke

Sebastian

0 Likes
Message 3 of 12

Anonymous
Not applicable

Screenshot (22).png

0 Likes
Message 4 of 12

Anonymous
Not applicable
sir kindly give solution
0 Likes
Message 5 of 12

cadffm
Consultant
Consultant

Sorry, it doesn't make any sense in my opinion.
I am here to impart knowledge or to help people help themselves.

I have also already written that "the solution" depends on two things.

 

@cadffm  schrieb:

the Syntax is also depending on

used options & blockproperties (uniform scale yes/no).


-

And if you trying to automate these steps, it is also important! How do you want to automate/send this to AutoCAD.

 

It's not a simple thing that is every time and by all ways the same.

-

 

So please, as i wrote:

Figured out yourself,

-INSERT<enter>

MyBlockname<enter>

..and your options and inputs

write it down, keystroke for keystroke

Open your Textscreen - so you can see more history lines

 

A simple sample for a non-uniformly block with only one attribut, attreq is on, attdia is off -> [F1]

-INSERT

0,0,0

1

1

0

MyAttVal

 

-

I can see, you are working in Excel, all in one line.

Ich you have a vba program which translate this and send the input step by step to AutoCAD, it's ok,

but you can not send it as one string, you need a real <Enter> to enter the Blockname and attributvalue!

Enter= linebreak or newline

Why? Because "Space" chr32 is a valid lcharacter in Blocknames and Attributvalues.

-

First question now:

How are you planning to transfer the commands from Excel to AutoCAD commandline?

Trying to create a Script by Excel? Or by VBA? Or with an vba program that sendcommand it step by step to ACAD?

 

Inside a Script you need this kind of list (with linebreaks as enter)

-INSERT MyBlock

0,0,0 1 1 myattrib1value

 

or

-INSERT MyBlock

0,0,0

1

1

myattrib1value

 

and so on.

 

 

Sebastian

0 Likes
Message 6 of 12

Anonymous
Not applicable
it is asking new block name
0 Likes
Message 7 of 12

leeminardi
Mentor
Mentor

Post #9 here may help you.

 

lee.minardi
0 Likes
Message 8 of 12

cadffm
Consultant
Consultant

We know hwo the program works and acting,

what we don't know: What you does!

 

Sorry, but "it is asking new block name" is totally useless without to know what you have and did.

Wen don't know your blockname, your block properties,

your settings and also not what you send to AutoCAD, and how.

You doesn't answered my questions..

?

 

 

Take the time, it is a question of days, weeks or month for some users,

you can not learn all in seconds, but the most important step: Is the first one.

"sir kindly give solution" - If you don't know what you do, this works just one time

and with the next problem you ask the same. Not useful.

 

I attach a sample, i am not sure that it helpful to you, but it is a try.

Read about the mentioned commands, try it line by line, step by step.

My sample is not "the solution", it is just one working sample, nothing more.

 

Open my DWG and run one of the *.scr files (drag&drop to ACAD or command: SCRIPT)

 

 

 

Sebastian

0 Likes
Message 9 of 12

Anonymous
Not applicable

i am asking what to xL syntax formula

 

0 Likes
Message 10 of 12

cadffm
Consultant
Consultant

Hi,

 

the golden formular is to learn how things working.

There is not "XL formular" or "XL syntax", you need to know how it must looks like

when it comes to *,scr file or into autocad commandline.

Then you can to what you want and how do you want,

the important thing is: The incoming syntax in AutoCAD have to match.

 

I showed you on sample,

how it can looks like in Excel, how in *.scr file and one DWG sample to test it.

 

There is just one simple rule, a real enter need a real linebreak.

 

Or if you have fullversion AutoCAD, create a Lisp-statement as Leeminardi linked to!

 

(command "input1" "input2"  "input3" "input4" ....)

 

(command "_.-INSERT" "DOOR" "_scale" "1" "*0,0,0" "0" "MyAttVal1")

Sebastian

0 Likes
Message 11 of 12

Pointdump
Consultant
Consultant

Hi Ram,
I struggle with this too. I always start with >>>This Post<<< from @Alfred.NESWADBA.
Dave

Dave Stoll
Las Vegas, Nevada

EESignature

64GB DDR4 2400MHz ECC SoDIMM / 1TB SSD
NVIDIA Quadro P5000 16GB
Windows 10 Pro 64 / Civil 3D 2027
0 Likes
Message 12 of 12

leeminardi
Mentor
Mentor

Place the following (exactly as shown) in cell J2 and fill down.

=CONCATENATE("(command ",CHAR(34),"-insert",CHAR(34)," ",CHAR(34),I2,CHAR(34)," ",CHAR(34),A2,",",B2,CHAR(34)," ",D2," ",E2," ",G2," ",CHAR(34),H2,CHAR(34)," )")

image.png

 

The z scale is not necessary.

Copy cells J2 to J4 to the clipboard then paste to the AutoCAD prompt or save as a .scr file and run in AutoCAD.

 

lee.minardi