• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

create complesi scripts for disegnare

Lucacr88

Guest
hi to everyone, I've been banging my head for a few days to create complex scripts to create autocad designs, it's an endless command managed by excel.
I have created my beautiful excel sheet that following logic of design of the component automatically calculates everything I want, with trigonometry and functions I go strong so I can establish to the great every coordination without problems.... and now I would like to exploit everything to create the design in autocad with two clicks!

I am not a great encoding expert with scripts but I learned the basics and I have already made good steps forward!
My biggest problem for the moment is the impossibility of creating through bevel scripts and/or strings of circumference as well as cutting curves segments and so on.. .
I tried to solve the problem by creating circles and then cutting the parts that I don't want and getting the desired connection, but the size command doesn't always work at 100% and depends on the decimal figures of the coordinates that calculation. . .

I also tried to use the arc command, always knowing and cmq calculate at least 3 points of the same I thought it would work smoothly and instead it always freezes!
I follow the command, accepts the first point.... and then you plant there, does not accept the second point and the dialog box says that you need coordinates 2d.... I have tried all, coordinates of whole or decimal numbers, I have tried not to specify the coordinate z=0, to make him change the reference between (first, second, end) (first, center, second) etc etc etc. but nothing to do :(

It is not a problem of zoom or encoding controls, I would say more than anything I can simulate the pick well and that I miss something else:(

Can any of you help me solve the problem?

I make a trivial example if someone wanted to answer me with a practical example:
I have two lines:
2,0,0 10,0
0.2,0 0.10,0
(so two long lines 8 perpendicular to each other)

by calculations I easily know the coordinates of 3 points that belong to the arc:
0.2
2,0
0.586,0.586

and in case it also serves the coordinates of the center:
2,2

Would you write me the script that can create this design?
I use autocad 2013!
 
thank you so much dieva, in the end I managed to solve going to attempts:finger:

I try to ask for another advice since I stuck on another stupidity...
How do I change color to lines?

I tried by changing layers, using the "color" command and using the _amlayer_hatc command but I have not yet left:(
the purpose is to create a series of white lines and curves and then draw a series of reds, the idea I wanted to follow was to activate the red color where it serves to then reactivate the white and vice versa, it would be a little uncomfortable to have 1500 lines of command "white" and 1500 "red" separated between them in blocks because often the two types of lines belong to the same component and separate them would create not little confusion:/

in addition to the color there is the difference in line thickness, so using standard autocad layers with _amlayer_" commands would be very comfortable!

Any suggestions? :
 
I think the only solution is with layers.
or create 2, one with white color and one with red color and from time to time make them current through the _amlayer command or, if you want to keep the objects all on a single layer in order to emphasize the membership to a same component, you will only need to change color to the lines of color other than that of the layer of belonging. the other 1500 of course will have the color of the layer.
so for example if the current layer has white color you just need to change color to the red lines. you will use the comado _color before drawing the lie or _change after drawing it.
another more elegant alternative could be to draw red objects with polylines in order to be able to select them with an autolisp instruction to pass to the command changes at the end of the script speeding up the whole procedure:
; script start
_
(ssget "x"(0 . "polyline"))

_
_
1

; fine script
 
Thanks again for the answer!
in reality colors do not serve to identify different components between them but to identify parts of each non- fundamental component or projections etc.

with _colore I thought I solved but it always blocks on the dialog and I can't aitomatize it, I like the idea of the layers but I can't handle it for nothing, I don't know the commands to create a new one and then interchange them between them:/

with the _amlayer_hatc command sets on the use of a red layer with 0.25 thick line (which is what I want for that type of lines) but then.... even if the next commands say to draw string lines etc draw them always and only white!
I checked that the lines take the color from "layer" and trying to track lines and how much more manually with the active hatc layer actually me draws red...

I don't know how to get out of it, would you be so infinitely kind to write me a script (not lips but a simple text sheet) of a script that alone draws a white line then a red one and finally another white?
Maybe inserting me the command lines that create layers that will then be used to draw?

in any case thank you for the help, you are number one:)
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top